Package org.jboss.remoting.marshal

Examples of org.jboss.remoting.marshal.UnMarshaller


            {
               invocationRequest = createNewInvocationRequest(request, response, null);
            } else
            {
               // must be POST or PUT
               UnMarshaller unmarshaller = getUnMarshaller();
               request.put(HTTPMetadataConstants.USE_REMOTING_CONTENT_TYPE, useRemotingContentType);
               Object obj = null;
               if (unmarshaller instanceof VersionedUnMarshaller)
                  obj = ((VersionedUnMarshaller)unmarshaller).read(request.getInputStream(), request, version);
               else
                  obj = unmarshaller.read(request.getInputStream(), request);
               if (obj instanceof InvocationRequest)
               {
                  receivedInvocationRequest.set(TRUE);
                  invocationRequest = (InvocationRequest) obj;
                  if (invocationRequest.getReturnPayload() == null)
View Full Code Here


      if (trace) { log.trace(this + "(" + (++invokeCount) + ") invoking " + invocationReq); }

      // Set up marshaller and unmarshaller.
      Marshaller marshaller = null;
      UnMarshaller unmarshaller = null;
      RemotingClassLoader rcl = null;
      synchronized (MicroRemoteClientInvoker.class)
      {
         marshaller = getMarshaller();
         if (marshaller == null)
         {
            // try by locator (in case marshaller class name specified)
            marshaller = MarshalFactory.getMarshaller(getLocator(), getClassLoader());
            if (marshaller == null)
            {
               // need to have a marshaller, so create a default one
               marshaller = MarshalFactory.getMarshaller(getDataType(), getSerializationType());
               if (marshaller == null)
               {
                  // went as far as possible to find a marshaller, will have to give up
                  throw new InvalidMarshallingResource(
                        "Can not find a valid marshaller for data type: " + getDataType());
               }
            }
            setMarshaller(marshaller);
         }
        
         unmarshaller = getUnMarshaller();
         if (unmarshaller == null)
         {
            // try by locator (in case unmarshaller class name specified)
            unmarshaller = MarshalFactory.getUnMarshaller(getLocator(), getClassLoader());
            if (unmarshaller == null)
            {
               unmarshaller = MarshalFactory.getUnMarshaller(getDataType(), getSerializationType());
               if (unmarshaller == null)
               {
                  // went as far as possible to find a unmarshaller, will have to give up
                  throw new InvalidMarshallingResource(
                        "Can not find a valid unmarshaller for data type: " + getDataType());
               }
            }
            setUnMarshaller(unmarshaller);
         }

         // Each unmarshaller gets a RemotingClassloader classloader containing the
         // remoting class loader (for remote classloading) and the current thread's
         // class loader.  This allows to load remoting classes as well as user's
         // classes.  If possible, will simply reset context classloader on existing
         // RemotingClassLoader.
         final ClassLoader contextClassLoader = SecurityUtility.getContextClassLoader(Thread.currentThread());
         if (unmarshaller instanceof UpdateableClassloaderUnMarshaller)
         {
            UpdateableClassloaderUnMarshaller uclum = (UpdateableClassloaderUnMarshaller) unmarshaller;
            ClassLoader cl = uclum.getClassLoader();
            if (cl instanceof RemotingClassLoader)
            {
               rcl = (RemotingClassLoader) cl;
               rcl.setUserClassLoader(contextClassLoader);
            }
            else
            {
               rcl = SecurityUtility.createRemotingClassLoader(getClassLoader(), contextClassLoader, parentFirstClassLoading);
               unmarshaller.setClassLoader(rcl);
            }
         }
         else
         {
            rcl = SecurityUtility.createRemotingClassLoader(getClassLoader(), contextClassLoader, parentFirstClassLoading);
            unmarshaller.setClassLoader(rcl)
         }
      }

      // if raw, then send only param of invocation request
      Object payload = null;
View Full Code Here

            serializationType = serializationTypeParam;
         }
      }

      Marshaller marshaller = null;
      UnMarshaller unmarshaller = null;
      int tempTimeout = -1;
      int savedTimeout = getTimeout();
     
      if (metadata != null)
      {
View Full Code Here

      }

      // setup remoting client           
      Map<String, Object> metadata = createRemotingMetaData(reqMessage, callProps);
      Marshaller marshaller = getMarshaller();
      UnMarshaller unmarshaller = getUnmarshaller();
      InvokerLocator locator = null;
      try
      {
         // Get the invoker from Remoting for a given endpoint address
         log.debug("Get locator for: " + endpoint);
View Full Code Here

      MessageAbstraction response = null;
      if (false == oneWay)
      {
         byte[] payload = rmResponse.getPayload();
         InputStream in = (payload == null) ? null : new ByteArrayInputStream(rmResponse.getPayload());
         UnMarshaller unmarshaller = (UnMarshaller)rmMetadata.getContext(SERIALIZATION_CONTEXT).get(UNMARSHALLER);
         response = (MessageAbstraction)unmarshaller.read(in, rmResponse.getMetadata().getContext(REMOTING_INVOCATION_CONTEXT));
      }
      Map<String, Object> invocationContext = rmMetadata.getContext(INVOCATION_CONTEXT);
      invocationContext.clear();
      invocationContext.putAll(rmMetadata.getContext(REMOTING_INVOCATION_CONTEXT));
      return response;
View Full Code Here

      int invokeCount = 0;

      if (trace) { log.trace(this + "(" + (++invokeCount) + ") invoking " + invocationReq); }

      Marshaller marshaller = getMarshaller();
      UnMarshaller unmarshaller = getUnMarshaller();

      if (marshaller == null)
      {
         // try by locator (in case marshaller class name specified)
         marshaller = MarshalFactory.getMarshaller(getLocator(), getClassLoader());
         if (marshaller == null)
         {
            // need to have a marshaller, so create a default one
            marshaller = MarshalFactory.getMarshaller(getDataType(), getSerializationType());
            if (marshaller == null)
            {
               // went as far as possible to find a marshaller, will have to give up
               throw new InvalidMarshallingResource(
                  "Can not find a valid marshaller for data type: " + getDataType());
            }
            setMarshaller(marshaller);
         }
      }

      if (unmarshaller == null)
      {
         // creating a new classloader containing the remoting class loader (for remote classloading)
         // and the current thread's class loader.  This allows to load remoting classes as well as
         // user's classes.
         ClassLoader remotingClassLoader = null;
         if (parentFirstClassLoading)
         {
            remotingClassLoader = new RemotingClassLoader(getClassLoader(), Thread.currentThread().getContextClassLoader());
         }
         else
         {
            remotingClassLoader = new RemotingClassLoader(Thread.currentThread().getContextClassLoader(), getClassLoader());
         }
        
         // try by locator (in case unmarshaller class name specified)
         unmarshaller = MarshalFactory.getUnMarshaller(getLocator(), getClassLoader());
         if (unmarshaller == null)
         {
            unmarshaller = MarshalFactory.getUnMarshaller(getDataType(), getSerializationType());
            if (unmarshaller == null)
            {
               // went as far as possible to find a unmarshaller, will have to give up
               throw new InvalidMarshallingResource(
                  "Can not find a valid unmarshaller for data type: " + getDataType());
            }
            setUnMarshaller(unmarshaller);
         }
         unmarshaller.setClassLoader(remotingClassLoader);
      }

      // if raw, then send only param of invocation request
      Object payload = null;
      Map metadata = invocationReq.getRequestPayload();
View Full Code Here

      int invokeCount = 0;

      if (trace) { log.trace(this + "(" + (++invokeCount) + ") invoking " + invocationReq); }

      Marshaller marshaller = getMarshaller();
      UnMarshaller unmarshaller = getUnMarshaller();

      if (marshaller == null)
      {
         // try by locator (in case marshaller class name specified)
         marshaller = MarshalFactory.getMarshaller(getLocator(), getClassLoader());
         if (marshaller == null)
         {
            // need to have a marshaller, so create a default one
            marshaller = MarshalFactory.getMarshaller(getDataType(), getSerializationType());
            if (marshaller == null)
            {
               // went as far as possible to find a marshaller, will have to give up
               throw new InvalidMarshallingResource(
                  "Can not find a valid marshaller for data type: " + getDataType());
            }
            setMarshaller(marshaller);
         }
      }

      if (unmarshaller == null)
      {
         // creating a new classloader containing the remoting class loader (for remote classloading)
         // and the current thread's class loader.  This allows to load remoting classes as well as
         // user's classes.
         ClassLoader remotingClassLoader =
            new RemotingClassLoader(getClassLoader(), Thread.currentThread().getContextClassLoader());
        
         // try by locator (in case unmarshaller class name specified)
         unmarshaller = MarshalFactory.getUnMarshaller(getLocator(), getClassLoader());
         if (unmarshaller == null)
         {
            unmarshaller = MarshalFactory.getUnMarshaller(getDataType(), getSerializationType());
            if (unmarshaller == null)
            {
               // went as far as possible to find a unmarshaller, will have to give up
               throw new InvalidMarshallingResource(
                  "Can not find a valid unmarshaller for data type: " + getDataType());
            }
            setUnMarshaller(unmarshaller);
         }
         unmarshaller.setClassLoader(remotingClassLoader);
      }

      // if raw, then send only param of invocation request
      Object payload = null;
      Map metadata = invocationReq.getRequestPayload();
View Full Code Here

            {
               invocationRequest = createNewInvocationRequest(request, response, null);
            } else
            {
               // must be POST or PUT
               UnMarshaller unmarshaller = getUnMarshaller();
               Object obj = null;
               if (unmarshaller instanceof VersionedUnMarshaller)
                  obj = ((VersionedUnMarshaller)unmarshaller).read(request.getInputStream(), request, version);
               else
                  obj = unmarshaller.read(request.getInputStream(), request);
               if (obj instanceof InvocationRequest)
               {
                  receivedInvocationRequest.set(TRUE);
                  invocationRequest = (InvocationRequest) obj;
                  if (invocationRequest.getReturnPayload() == null)
View Full Code Here

            serializationType = serializationTypeParam;
         }
      }

      Marshaller marshaller = null;
      UnMarshaller unmarshaller = null;
      int tempTimeout = -1;
      int savedTimeout = getTimeout();
     
      if (metadata != null)
      {
View Full Code Here

      }

      // setup remoting client           
      Map<String, Object> metadata = createRemotingMetaData(reqMessage, callProps);
      Marshaller marshaller = getMarshaller();
      UnMarshaller unmarshaller = getUnmarshaller();
      InvokerLocator locator = null;
      try
      {
         // Get the invoker from Remoting for a given endpoint address
         log.debug("Get locator for: " + endpoint);
View Full Code Here

TOP

Related Classes of org.jboss.remoting.marshal.UnMarshaller

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.