protected void bindProxy() throws Exception
{
try
{
// Create a stack from the description (in the future) for now we hardcode it
InvocationContext context = new InvocationContext();
context.setObjectName(jmxNameHashInteger);
context.setValue(InvocationKey.JNDI_NAME, jndiBinding);
// The behavior for home proxying should be isolated in an interceptor FIXME
context.setInvoker(homeInvoker);
context.setValue(InvocationKey.EJB_METADATA, ejbMetaData);
context.setInvokerProxyBinding(invokerMetaData.getName());
if(container.getSecurityManager() != null)
{
String secDomain = container.getSecurityManager().getSecurityDomain();
context.setValue(InvocationKey.SECURITY_DOMAIN, secDomain);
}
ClientContainer client = null;
EJBProxyFactoryContainer pfc = (EJBProxyFactoryContainer) container;
Class[] ifaces = {pfc.getHomeClass(), Class.forName("javax.ejb.Handle")};
if( includeIClientIface )
{
ifaces = new Class[] {IClientContainer.class, pfc.getHomeClass(),
Class.forName("javax.ejb.Handle")};
client = new ClientContainerEx(context);
}
else
{
client = new ClientContainer(context);
}
loadInterceptorChain(homeInterceptorClasses, client);
// Create the EJBHome
this.home = (EJBHome) Proxy.newProxyInstance(
// Class loader pointing to the right classes from deployment
pfc.getHomeClass().getClassLoader(),
// The classes we want to implement home and handle
ifaces,
// The home proxy as invocation handler
client);
// Create stateless session object
// Same instance is used for all objects
if(ejbMetaData.isStatelessSession() == true)
{
// Create a stack from the description (in the future) for now we hardcode it
context = new InvocationContext();
context.setObjectName(jmxNameHashInteger);
context.setValue(InvocationKey.JNDI_NAME, jndiBinding);
// The behavior for home proxying should be isolated in an interceptor FIXME
context.setInvoker(beanInvoker);
context.setInvokerProxyBinding(invokerMetaData.getName());
context.setValue(InvocationKey.EJB_HOME, home);
if(container.getSecurityManager() != null)
{
String secDomain = container.getSecurityManager().getSecurityDomain();
context.setValue(InvocationKey.SECURITY_DOMAIN, secDomain);
}
Class[] ssifaces = {pfc.getRemoteClass()};
if( includeIClientIface )
{