org.jboss.remoting
Class AbstractInvoker

java.lang.Object
  extended byorg.jboss.remoting.AbstractInvoker
All Implemented Interfaces:
Invoker
Direct Known Subclasses:
ClientInvoker, LocalClientInvoker, RemoteClientInvoker, ServerInvoker

public abstract class AbstractInvoker
extends Object
implements Invoker

AbstractInvoker is an abstract handler part that contains common methods between both client and server.

Version:
$Revision: 1.8 $
Author:
Jeff Haynie, Tom Elrod

Field Summary
protected  ClassByteClassLoader classbyteloader
           
protected  InvokerLocator localServerLocator
           
protected  InvokerLocator locator
           
protected  org.jboss.logging.Logger log
           
protected static boolean logExtra
           
 
Constructor Summary
AbstractInvoker(InvokerLocator locator)
           
 
Method Summary
 void addClass(ClassBytes neededClass)
          add a remote class to the local loader to make the class visible to the handler
 byte[] getClassBytes(String className)
          method is called to retrieve a byte array of a Class for a given class name
 InvokerLocator getClientLocator()
          Gets the client locator.
 InvokerLocator getLocator()
          return the locator this Invoker represents
 Class loadClass(String className)
          load a class, taking into account the remote classes downloaded, if any.
protected  byte[] read(InputStream in)
          simple utility method for reading bytes from an input stream
 void setClassLoader(ClassLoader classloader)
          set the classloader to use internally
 void setClientLocator(InvokerLocator locator)
          This should be set when want to override the default behavior of automatically getting s suitable locator.
protected  Object unmarshal(ClassBytes resultBytes, ClassBytes neededClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logExtra

protected static boolean logExtra

log

protected final org.jboss.logging.Logger log

classbyteloader

protected ClassByteClassLoader classbyteloader

locator

protected InvokerLocator locator

localServerLocator

protected InvokerLocator localServerLocator
Constructor Detail

AbstractInvoker

public AbstractInvoker(InvokerLocator locator)
Method Detail

getLocator

public InvokerLocator getLocator()
return the locator this Invoker represents

Specified by:
getLocator in interface Invoker
Returns:

setClientLocator

public void setClientLocator(InvokerLocator locator)
This should be set when want to override the default behavior of automatically getting s suitable locator. This should be used want want to control what type of callbacks to receive (pull or push). Set to null to poll for callback messages. This can also be used to receive callbacks using another transport and subsystem, if desired.

Parameters:
locator -

getClientLocator

public InvokerLocator getClientLocator()
Gets the client locator. This locator will be used by the server side to make callbacks to the handler for this locator.

Returns:

setClassLoader

public void setClassLoader(ClassLoader classloader)
set the classloader to use internally

Parameters:
classloader -

read

protected byte[] read(InputStream in)
               throws IOException
simple utility method for reading bytes from an input stream

Parameters:
in -
Returns:
Throws:
IOException

getClassBytes

public byte[] getClassBytes(String className)
method is called to retrieve a byte array of a Class for a given class name

Parameters:
className -
Returns:

addClass

public void addClass(ClassBytes neededClass)
              throws IOException
add a remote class to the local loader to make the class visible to the handler

Parameters:
neededClass -
Throws:
IOException

loadClass

public Class loadClass(String className)
                throws ClassNotFoundException
load a class, taking into account the remote classes downloaded, if any. this class will use the following order for finding the class:
  1. look at the ClassByteClassLoader associated with this handler
  2. look at the Thread ContextClassLoader (if any)
  3. look at the System ClassLoader

Parameters:
className -
Returns:
Throws:
ClassNotFoundException

unmarshal

protected Object unmarshal(ClassBytes resultBytes,
                           ClassBytes neededClass)
                    throws ClassNotFoundException,
                           StreamCorruptedException,
                           IOException
Throws:
ClassNotFoundException
StreamCorruptedException
IOException


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.