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();
               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

   }

   public UnMarshaller getUnMarshaller()
   {
      ClassLoader classLoader = SecurityUtility.getClassLoader(WebServerInvoker.class);
      UnMarshaller unmarshaller = MarshalFactory.getUnMarshaller(getLocator(), classLoader);
      if(unmarshaller == null)
      {
         unmarshaller = MarshalFactory.getUnMarshaller(getDataType(), getSerializationType());
      }
      return unmarshaller;
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);
               unmarshaller.setClassLoader(rcl);
            }
         }
         else
         {
            rcl = SecurityUtility.createRemotingClassLoader(getClassLoader(), contextClassLoader);
            unmarshaller.setClassLoader(rcl)
         }
      }

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

/*  61 */     int invokeCount = 0;
/*     */
/*  63 */     if (this.trace) { invokeCount++; log.trace(this + "(" + invokeCount + ") invoking " + invocationReq);
/*     */     }
/*  65 */     Marshaller marshaller = getMarshaller();
/*  66 */     UnMarshaller unmarshaller = getUnMarshaller();
/*     */
/*  68 */     if (marshaller == null)
/*     */     {
/*  71 */       marshaller = MarshalFactory.getMarshaller(getLocator(), getClassLoader());
/*  72 */       if (marshaller == null)
/*     */       {
/*  75 */         marshaller = MarshalFactory.getMarshaller(getDataType(), getSerializationType());
/*  76 */         if (marshaller == null)
/*     */         {
/*  79 */           throw new InvalidMarshallingResource("Can not find a valid marshaller for data type: " + getDataType());
/*     */         }
/*     */
/*  82 */         setMarshaller(marshaller);
/*     */       }
/*     */     }
/*     */
/*  86 */     if (unmarshaller == null)
/*     */     {
/*  91 */       ClassLoader remotingClassLoader = new RemotingClassLoader(getClassLoader(), Thread.currentThread().getContextClassLoader());
/*     */
/*  95 */       unmarshaller = MarshalFactory.getUnMarshaller(getLocator(), getClassLoader());
/*  96 */       if (unmarshaller == null)
/*     */       {
/*  98 */         unmarshaller = MarshalFactory.getUnMarshaller(getDataType(), getSerializationType());
/*  99 */         if (unmarshaller == null)
/*     */         {
/* 102 */           throw new InvalidMarshallingResource("Can not find a valid unmarshaller for data type: " + getDataType());
/*     */         }
/*     */
/* 105 */         setUnMarshaller(unmarshaller);
/*     */       }
/* 107 */       unmarshaller.setClassLoader(remotingClassLoader);
/*     */     }
/*     */
/* 111 */     Object payload = null;
/* 112 */     Map metadata = invocationReq.getRequestPayload();
/* 113 */     if ((metadata != null) && (metadata.get("rawPayload") != null))
View Full Code Here

/*     */         {
/* 540 */           request = createNewInvocationRequest(metadata, null);
/*     */         }
/*     */         else
/*     */         {
/* 544 */           UnMarshaller unmarshaller = getUnMarshaller();
/* 545 */           Object obj = unmarshaller.read(dataInput, metadata);
/*     */
/* 548 */           if ((obj instanceof InvocationRequest))
/*     */           {
/* 550 */             request = (InvocationRequest)obj;
/*     */           }
View Full Code Here

      }

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

/*      */       {
/*  462 */         invocationRequest = createNewInvocationRequest(request, response, null);
/*      */       }
/*      */       else
/*      */       {
/*  466 */         UnMarshaller unmarshaller = getUnMarshaller();
/*  467 */         Object obj = null;
/*  468 */         if ((unmarshaller instanceof VersionedUnMarshaller))
/*  469 */           obj = ((VersionedUnMarshaller)unmarshaller).read(request.getInputStream(), request, version);
/*      */         else
/*  471 */           obj = unmarshaller.read(request.getInputStream(), request);
/*  472 */         if ((obj instanceof InvocationRequest))
/*      */         {
/*  474 */           receivedInvocationRequest.set(TRUE);
/*  475 */           invocationRequest = (InvocationRequest)obj;
/*  476 */           if (invocationRequest.getReturnPayload() == null)
View Full Code Here

/* 136 */         serializationType = serializationTypeParam;
/*     */       }
/*     */     }
/*     */
/* 140 */     Marshaller marshaller = null;
/* 141 */     UnMarshaller unmarshaller = null;
/* 142 */     int tempTimeout = -1;
/* 143 */     int savedTimeout = getTimeout();
/*     */
/* 145 */     if (metadata != null)
/*     */     {
View Full Code Here

/*     */     try
/*     */     {
/* 106 */       Object invocationResponse = null;
/*     */
/* 108 */       ServletInputStream inputStream = request.getInputStream();
/* 109 */       UnMarshaller unmarshaller = MarshalFactory.getUnMarshaller("http", getSerializationType());
/* 110 */       Object obj = null;
/* 111 */       if ((unmarshaller instanceof VersionedUnMarshaller))
/* 112 */         obj = ((VersionedUnMarshaller)unmarshaller).read(inputStream, metadata, Version.getDefaultVersion());
/*     */       else
/* 114 */         obj = unmarshaller.read(inputStream, metadata);
/* 115 */       inputStream.close();
/*     */
/* 117 */       InvocationRequest invocationRequest = null;
/*     */
/* 119 */       if ((obj instanceof InvocationRequest))
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.