Exemplo n.º 1
0
        private void initializeIntrospection()
        {
            string @string = this.GetString("runtime.introspector.uberspect");

            if (@string == null || @string.Length <= 0)
            {
                string message = "It appears that no class was specified as the Uberspect.  Please ensure that all configuration information is correct.";
                this.Error(message);
                throw new System.Exception(message);
            }
            object obj;

            try
            {
                obj = SupportClass.CreateNewInstance(Type.GetType(@string));
            }
            catch (System.Exception)
            {
                string message = "The specified class for Uberspect (" + @string + ") does not exist (or is not accessible to the current classlaoder.";
                this.Error(message);
                throw new System.Exception(message);
            }
            if (!(obj is IUberspect))
            {
                string message = "The specified class for Uberspect (" + @string + ") does not implement org.apache.velocity.util.introspector.Uberspect. Velocity not initialized correctly.";
                this.Error(message);
                throw new System.Exception(message);
            }
            this.uberSpect = (IUberspect)obj;
            if (this.uberSpect is UberspectLoggable)
            {
                ((UberspectLoggable)this.uberSpect).RuntimeLogger = this;
            }
            this.uberSpect.Init();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the classname for the Uberspect introspection package and
        /// instantiates an instance.
        /// </summary>
        private void initializeIntrospection()
        {
            String rm = GetString(RuntimeConstants.UBERSPECT_CLASSNAME);

            if (rm != null && rm.Length > 0)
            {
                Object o;

                try
                {
                    o = SupportClass.CreateNewInstance(Type.GetType(rm));
                }
                catch (System.Exception)
                {
                    String err =
                        string.Format(
                            "The specified class for Uberspect ({0}) does not exist (or is not accessible to the current classlaoder.", rm);
                    Error(err);
                    throw new System.Exception(err);
                }

                if (!(o is IUberspect))
                {
                    String err =
                        string.Format(
                            "The specified class for Uberspect ({0}) does not implement org.apache.velocity.util.introspector.Uberspect. Velocity not initialized correctly.",
                            rm);

                    Error(err);
                    throw new System.Exception(err);
                }

                uberSpect = (IUberspect)o;

                if (uberSpect is UberspectLoggable)
                {
                    ((UberspectLoggable)uberSpect).RuntimeLogger = this;
                }

                uberSpect.Init();
            }
            else
            {
                // someone screwed up.  Lets not fool around...
                String err =
                    "It appears that no class was specified as the Uberspect.  Please ensure that all configuration information is correct.";

                Error(err);
                throw new System.Exception(err);
            }
        }
Exemplo n.º 3
0
		/// <summary>
		/// Gets the classname for the Uberspect introspection package and
		/// instantiates an instance.
		/// </summary>
		private void initializeIntrospection()
		{
			String rm = GetString(RuntimeConstants.UBERSPECT_CLASSNAME);

			if (rm != null && rm.Length > 0)
			{
				Object o;

				try
				{
					o = SupportClass.CreateNewInstance(Type.GetType(rm));
				}
				catch(System.Exception)
				{
					String err =
						string.Format(
							"The specified class for Uberspect ({0}) does not exist (or is not accessible to the current classlaoder.", rm);
					Error(err);
					throw new System.Exception(err);
				}

				if (!(o is IUberspect))
				{
					String err =
						string.Format(
							"The specified class for Uberspect ({0}) does not implement org.apache.velocity.util.introspector.Uberspect. Velocity not initialized correctly.",
							rm);

					Error(err);
					throw new System.Exception(err);
				}

				uberSpect = (IUberspect) o;

				if (uberSpect is UberspectLoggable)
				{
					((UberspectLoggable) uberSpect).RuntimeLogger = this;
				}

				uberSpect.Init();
			}
			else
			{
				// someone screwed up.  Lets not fool around...
				String err =
					"It appears that no class was specified as the Uberspect.  Please ensure that all configuration information is correct.";

				Error(err);
				throw new System.Exception(err);
			}
		}
Exemplo n.º 4
0
 /// <summary> Constructor that takes the two uberspectors to link</summary>
 public LinkingUberspector(IUberspect left, IUberspect right)
 {
     leftUberspect  = left;
     rightUberspect = right;
 }
Exemplo n.º 5
0
 /// <summary> {@inheritDoc}
 ///
 /// </summary>
 /// <seealso cref="ChainableUberspector.wrap(org.apache.velocity.util.introspection.Uberspect)">
 /// </seealso>
 /// <seealso cref="inner">
 /// </seealso>
 public virtual void Wrap(IUberspect inner)
 {
     this.inner = inner;
 }