|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy
Abstract superclass of JRMP client-side proxies.
ContainerRemote
, Serialized FormField Summary | |
protected ContainerRemote |
container
The remote interface of the container invoker of the container we proxy for. |
protected static java.lang.Object[] |
EMPTY_ARGS
An empty method parameter list. |
protected static java.lang.reflect.Method |
EQUALS
Object.equals(java.lang.Object) method reference. |
protected static java.lang.reflect.Method |
HASH_CODE
Object.hashCode() method reference. |
protected InitialContextHandle |
initialContextHandle
Provides access to the correct naming context for handle objects. |
protected java.lang.String |
name
The JNDI name of the container that we proxy for. |
protected boolean |
optimize
If true, this proxy will attempt to optimize
VM-local calls. |
protected static java.lang.reflect.Method |
TO_STRING
Object.toString() method reference. |
protected static TransactionPropagationContextFactory |
tpcFactory
Factory for transaction propagation contexts. |
Constructor Summary | |
|
GenericProxy()
A public, no-args constructor for externalization to work. |
protected |
GenericProxy(java.lang.String name,
ContainerRemote container,
boolean optimize)
Create a new GenericProxy. |
Method Summary | |
static void |
addLocal(java.lang.String jndiName,
ContainerRemote invoker)
Add an invoker to the invokers map. |
protected javax.naming.InitialContext |
createInitialContext()
Create an InitialContext using the saved environment or create a vanilla InitialContext when the enviroment is null. |
protected java.rmi.MarshalledObject |
createMarshalledObject(java.lang.Object id,
java.lang.reflect.Method method,
java.lang.Object[] args)
Create a MarshalledObject suitable for invoking a remote container with. |
protected java.lang.Object |
getCredential()
Return the credentials to use for invocations with this proxy. |
protected java.security.Principal |
getPrincipal()
Return the principal to use for invocations with this proxy. |
protected javax.transaction.Transaction |
getTransaction()
Return the transaction associated with the current thread. |
protected java.lang.Object |
getTransactionPropagationContext()
Return the transaction propagation context of the transaction associated with the current thread. |
protected java.lang.Object |
invokeContainer(java.lang.Object id,
java.lang.reflect.Method method,
java.lang.Object[] args)
Invoke the container to handle this method invocation. |
protected boolean |
isLocal()
Returns true iff this instance lives in the same
VM as its container. |
void |
readExternal(java.io.ObjectInput in)
Un-externalize this instance. |
static void |
removeLocal(java.lang.String jndiName)
Remove an invoker from the invokers map. |
static void |
setTPCFactory(TransactionPropagationContextFactory tpcf)
Set the transaction propagation context factory. |
static void |
setTransactionManager(javax.transaction.TransactionManager txMan)
Set the transaction manager. |
void |
writeExternal(java.io.ObjectOutput out)
Externalize this instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.Object[] EMPTY_ARGS
protected static final java.lang.reflect.Method TO_STRING
Object.toString()
method reference.protected static final java.lang.reflect.Method HASH_CODE
Object.hashCode()
method reference.protected static final java.lang.reflect.Method EQUALS
Object.equals(java.lang.Object)
method reference.protected static TransactionPropagationContextFactory tpcFactory
null
, transactions are not propagated on
remote method invocations.protected java.lang.String name
protected ContainerRemote container
protected boolean optimize
true, this proxy will attempt to optimize
VM-local calls.
protected InitialContextHandle initialContextHandle
Constructor Detail |
public GenericProxy()
protected GenericProxy(java.lang.String name, ContainerRemote container, boolean optimize)
name
- The JNDI name of the container that we proxy for.container
- The remote interface of the container invoker of the
container we proxy for.optimize
- If true, this proxy will attempt to optimize
VM-local calls.
Method Detail |
public static void addLocal(java.lang.String jndiName, ContainerRemote invoker)
public static void removeLocal(java.lang.String jndiName)
public static void setTransactionManager(javax.transaction.TransactionManager txMan)
public static void setTPCFactory(TransactionPropagationContextFactory tpcf)
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
protected java.security.Principal getPrincipal()
protected java.lang.Object getCredential()
protected javax.transaction.Transaction getTransaction() throws javax.transaction.SystemException
null
if the transaction manager was never
set, or if no transaction is associated with the current thread.protected java.lang.Object getTransactionPropagationContext() throws javax.transaction.SystemException
null
if the transaction manager was never
set, or if no transaction is associated with the current thread.protected boolean isLocal()
true
iff this instance lives in the same
VM as its container.protected javax.naming.InitialContext createInitialContext() throws javax.naming.NamingException
javax.naming.NamingException
- Failed to create InitialContext.protected java.lang.Object invokeContainer(java.lang.Object id, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
If optimization is enabled and this is a local proxy, then the container is invoked directly, else a remote call is made.
id
- ???method
- The method to invoke.args
- The arguments passed to the method.java.lang.Throwable
- Failed to invoke container.protected java.rmi.MarshalledObject createMarshalledObject(java.lang.Object id, java.lang.reflect.Method method, java.lang.Object[] args) throws javax.transaction.SystemException, java.io.IOException
id
- ???method
- The method to invoke.args
- The arguments passed to the method.javax.transaction.SystemException
- Failed to get transaction.java.io.IOException
- Failed to create MarshalledObject.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |