org.jboss.aspects.remoting
Class RemotingProxyFactory

java.lang.Object
  extended by org.jboss.aspects.remoting.RemotingProxyFactory

public class RemotingProxyFactory
extends Object

RemotingProxyFactory is an AOP / Remoting replacement for org.jboss.invocation.jrmp.server.JRMPProxyFactory.

Given the following parameters

RemotingProxyFactory will create a proxy that

  1. implements the interfaces,
  2. makes invocations through the chain of client side interceptors,
  3. sends invocations to the remote Connector where they are processed by the provided target,

and, if the JNDI name property has been set, it will bind the proxy to the provided name in JNDI.

Version:
$Revision: 1.1 $

Copyright Jun 6, 2008

Author:
Ron Sigal

Constructor Summary
RemotingProxyFactory()
           
 
Method Summary
 org.jboss.remoting.transport.Connector getConnector()
          Returns the Remoting Connector that directs invocations to the AOPRemotingInvocationHandler, which then directs invocations to the target
 String getDispatchName()
          Returns the name under which the AOP dispatcher will register the target
 ArrayList<?> getInterceptors()
          Returns the interceptors through which an invocation will pass on the client side.
 Class<?>[] getInterfaces()
          Returns the interfaces implemented by the proxy created by this instance of RemotingProxyFactory
 String getInvokerLocator()
          Returns the String form of the InvokerLocator that identifies the Remoting Connector that directs invocations to the AOPRemotingInvocationHandler, which then directs invocations to the target
 String getJndiName()
          Returns the name to which the proxy will be bound in JNDI
 org.jboss.aop.proxy.Proxy getProxy()
          Returns the proxy created by this instance of RemotingProxyFactory
 String getSubsystem()
          Returns the subsystem name that identifes the AOPRemotingInvocationHandler running in the Remoting Connector.
 Object getTarget()
          Returns the target to which the AOP dispatcher will direct invocations
 void setConnector(org.jboss.remoting.transport.Connector connector)
          Sets the Remoting Connector that directs invocations to the AOPRemotingInvocationHandler, which then directs invocations to the target
 void setDispatchName(String dispatchName)
          Sets the name under which the AOP dispatcher will register the target
 void setInterceptors(ArrayList<?> interceptors)
          Sets the interceptors through which an invocation will pass on the client side.
 void setInterfaces(Class<?>[] interfaces)
          Sets the interfaces implemented by the proxy created by this instance of RemotingProxyFactory
 void setInvokerLocator(String locator)
          Sets the String form of the InvokerLocator that identifies the Remoting Connector that directs invocations to the AOPRemotingInvocationHandler, which then directs invocations to the target
 void setJndiName(String jndiName)
          Sets the name to which the proxy will be bound in JNDI
 void setSubsystem(String subsystem)
          Sets the subsystem name that identifes the AOPRemotingInvocationHandler running in the Remoting Connector.
 void setTarget(Object target)
          Sets the target to which the AOP dispatcher will direct invocations
 void start()
          Lifecycle method.
 void stop()
          Lifecycle method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemotingProxyFactory

public RemotingProxyFactory()
Method Detail

getTarget

public Object getTarget()
Returns the target to which the AOP dispatcher will direct invocations

Returns:
the target to which the AOP dispatcher will direct invocations

setTarget

public void setTarget(Object target)
Sets the target to which the AOP dispatcher will direct invocations

Parameters:
target - the target to which the AOP dispatcher will direct invocations

getInterfaces

public Class<?>[] getInterfaces()
Returns the interfaces implemented by the proxy created by this instance of RemotingProxyFactory

Returns:
the interfaces implemented by the proxy created by this instance of RemotingProxyFactorys

setInterfaces

public void setInterfaces(Class<?>[] interfaces)
Sets the interfaces implemented by the proxy created by this instance of RemotingProxyFactory

Parameters:
interfaces - the interfaces implemented by the proxy created by this instance of RemotingProxyFactory

getDispatchName

public String getDispatchName()
Returns the name under which the AOP dispatcher will register the target

Returns:
the name under which the AOP dispatcher will register the target

setDispatchName

public void setDispatchName(String dispatchName)
Sets the name under which the AOP dispatcher will register the target

Parameters:
dispatchName - the name under which the AOP dispatcher will register the target

getJndiName

public String getJndiName()
Returns the name to which the proxy will be bound in JNDI

Returns:
the name to which the proxy will be bound in JNDI

setJndiName

public void setJndiName(String jndiName)
Sets the name to which the proxy will be bound in JNDI

Parameters:
jndiName - the name to which the proxy will be bound in JNDI

getInvokerLocator

public String getInvokerLocator()
Returns the String form of the InvokerLocator that identifies the Remoting Connector that directs invocations to the AOPRemotingInvocationHandler, which then directs invocations to the target

Returns:
the String form of the InvokerLocator that identifies the Remoting Connector that directs invocations to the AOPRemotingInvocationHandler, which then directs invocations to the target

setInvokerLocator

public void setInvokerLocator(String locator)
                       throws MalformedURLException
Sets the String form of the InvokerLocator that identifies the Remoting Connector that directs invocations to the AOPRemotingInvocationHandler, which then directs invocations to the target

Parameters:
locator - the String form of the InvokerLocator that identifies the Remoting Connector that directs invocations to the AOPRemotingInvocationHandler, which then directs invocations to the target
Throws:
MalformedURLException

getConnector

public org.jboss.remoting.transport.Connector getConnector()
Returns the Remoting Connector that directs invocations to the AOPRemotingInvocationHandler, which then directs invocations to the target

Returns:
the Remoting Connector that directs invocations to the AOPRemotingInvocationHandler, which then directs invocations to the target

setConnector

public void setConnector(org.jboss.remoting.transport.Connector connector)
Sets the Remoting Connector that directs invocations to the AOPRemotingInvocationHandler, which then directs invocations to the target

Parameters:
connector - the Remoting Connector that directs invocations to the AOPRemotingInvocationHandler, which then directs invocations to the target

getSubsystem

public String getSubsystem()
Returns the subsystem name that identifes the AOPRemotingInvocationHandler running in the Remoting Connector. Defaults to "AOP".

Returns:
the subsystem name that identifes the AOPRemotingInvocationHandler running in the Remoting Connector. Defaults to "AOP".

setSubsystem

public void setSubsystem(String subsystem)
Sets the subsystem name that identifes the AOPRemotingInvocationHandler running in the Remoting Connector. Defaults to "AOP".

Parameters:
subsystem - the subsystem name that identifes the AOPRemotingInvocationHandler running in the Remoting Connector. Defaults to "AOP".

getInterceptors

public ArrayList<?> getInterceptors()
Returns the interceptors through which an invocation will pass on the client side.

N.B. Each element of the list is either

  1. the fully qualified class name of an interceptor, or
  2. an interceptor POJO.

Returns:
the interceptors through which an invocation will pass on the client side.

setInterceptors

public void setInterceptors(ArrayList<?> interceptors)
Sets the interceptors through which an invocation will pass on the client side.

N.B. Each element of the list must be either

  1. the fully qualified class name of an interceptor, or
  2. an interceptor POJO.

If the element is a class name, then the class must have either

  1. a public static field named "singleton" that holds an instance of the interceptor, or
  2. a default constructor.

N.B.The interceptors MergeMetaDataInterceptor and InvokeRemoteInterceptor are automatically appended to the end of the list.

Parameters:
interceptors - the interceptors through which an invocation will pass on the client side.

getProxy

public org.jboss.aop.proxy.Proxy getProxy()
Returns the proxy created by this instance of RemotingProxyFactory

Returns:
the proxy created by this instance of RemotingProxyFactory

start

public void start()
           throws Exception
Lifecycle method.

The lifecycle method that

  1. registers the target with the AOP dispatcher
  2. creates the proxy
  3. binds the proxy in JNDI

Throws:
Exception

stop

public void stop()
          throws Exception
Lifecycle method.

The lifecycle method that

  1. unregisters the target with AOP dispatcher
  2. unbinds the proxy from JNDI

Throws:
Exception


Copyright © 2008 JBoss Inc.. All Rights Reserved.