org.jboss.ejb3.proxy.impl.objectfactory
Class ProxyObjectFactory

java.lang.Object
  extended by org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory
All Implemented Interfaces:
Serializable, ObjectFactory
Direct Known Subclasses:
Ejb3RegistrarProxyObjectFactory

public abstract class ProxyObjectFactory
extends Object
implements ObjectFactory, Serializable

ProxyObjectFactory Base upon which Proxy Object Factories may build. Defines abstractions to:

Version:
$Revision: $
Author:
ALR
See Also:
Serialized Form

Constructor Summary
ProxyObjectFactory()
           
 
Method Summary
protected  ProxyFactory createProxyFactoryProxy(Name name, Map<String,List<String>> refAddrs, String proxyFactoryRegistryKey)
          Creates a remoting proxy to the proxy factory.
 Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment)
          Returns an appropriate Proxy based on the Reference Address information associated with the Reference (obj) bound at name in the specified nameCtx with specified environment.
protected abstract  Object getProxy(ProxyFactory proxyFactory, Name name, Map<String,List<String>> referenceAddresses)
           
protected abstract  Class<?> getProxyFactoryClass()
          Obtains the type or supertype used by proxy factories for this Object Factory
protected  String getSingleReferenceAddressValue(Name name, Map<String,List<String>> referenceAddresses, String refAddrType)
          Obtains the single value of the specified type as obtained from the specified reference addresses bound at the specified Name.
protected  String getSingleRequiredReferenceAddressValue(Name name, Map<String,List<String>> referenceAddresses, String refAddrType)
          Obtains the single value of the specified type as obtained from the specified reference addresses bound at the specified Name.
protected  boolean hasBusiness(Name name, Map<String,List<String>> referenceAddresses)
          Looks to the metadata specified by the reference addresses to determine if an EJB3 Business View is defined here.
protected  boolean hasLocalBusiness(Map<String,List<String>> referenceAddresses)
          Determines if the specified metadata contains a type of local business
protected  boolean hasRemoteBusiness(Map<String,List<String>> referenceAddresses)
          Determines if the specified metadata contains a type of remote business
protected  Object redefineProxyInTcl(Object proxy)
          If the specified proxy has been defined outside of this naming Context's ClassLoader, it must be reconstructed using the TCL so we avoid CCE.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyObjectFactory

public ProxyObjectFactory()
Method Detail

getObjectInstance

public Object getObjectInstance(Object obj,
                                Name name,
                                Context nameCtx,
                                Hashtable<?,?> environment)
                         throws Exception
Returns an appropriate Proxy based on the Reference Address information associated with the Reference (obj) bound at name in the specified nameCtx with specified environment.

Specified by:
getObjectInstance in interface ObjectFactory
Throws:
Exception
See Also:
ObjectFactory.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable)

createProxyFactoryProxy

protected ProxyFactory createProxyFactoryProxy(Name name,
                                               Map<String,List<String>> refAddrs,
                                               String proxyFactoryRegistryKey)
                                        throws Exception
Creates a remoting proxy to the proxy factory.

Parameters:
name -
refAddrs -
proxyFactoryRegistryKey -
Returns:
Throws:
Exception

getSingleRequiredReferenceAddressValue

protected String getSingleRequiredReferenceAddressValue(Name name,
                                                        Map<String,List<String>> referenceAddresses,
                                                        String refAddrType)
Obtains the single value of the specified type as obtained from the specified reference addresses bound at the specified Name. Asserts that the value exists and is the only one for the specified type.

Parameters:
name -
referenceAddresses -
refAddrType -
Returns:

getSingleReferenceAddressValue

protected String getSingleReferenceAddressValue(Name name,
                                                Map<String,List<String>> referenceAddresses,
                                                String refAddrType)
Obtains the single value of the specified type as obtained from the specified reference addresses bound at the specified Name. Asserts that the value exists and is the only one for the specified type.

Parameters:
name -
referenceAddresses -
refAddrType -
Returns:

hasBusiness

protected boolean hasBusiness(Name name,
                              Map<String,List<String>> referenceAddresses)
Looks to the metadata specified by the reference addresses to determine if an EJB3 Business View is defined here. Additionally checks that both local and remote business interfaces are not bound to the same JNDI Address

Parameters:
name -
referenceAddresses -
Returns:

redefineProxyInTcl

protected Object redefineProxyInTcl(Object proxy)
If the specified proxy has been defined outside of this naming Context's ClassLoader, it must be reconstructed using the TCL so we avoid CCE. This is especially vital using a scope ClassLoader (ie. has defined by Servlet spec during Web Injection)

Parameters:
proxy -

hasLocalBusiness

protected boolean hasLocalBusiness(Map<String,List<String>> referenceAddresses)
Determines if the specified metadata contains a type of local business

Parameters:
referenceAddresses -
Returns:

hasRemoteBusiness

protected boolean hasRemoteBusiness(Map<String,List<String>> referenceAddresses)
Determines if the specified metadata contains a type of remote business

Parameters:
referenceAddresses -
Returns:

getProxy

protected abstract Object getProxy(ProxyFactory proxyFactory,
                                   Name name,
                                   Map<String,List<String>> referenceAddresses)

getProxyFactoryClass

protected abstract Class<?> getProxyFactoryClass()
Obtains the type or supertype used by proxy factories for this Object Factory

Returns:


Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.