Methods Summary |
---|
protected boolean | bindHomeAndBusinessTogether(org.jboss.ejb3.EJBContainer container)
return ProxyFactoryHelper.getLocalHomeJndiName(container).equals(ProxyFactoryHelper.getLocalJndiName(container));
|
public java.lang.Object | createProxy()
return constructProxy(new StatelessLocalProxy(container));
|
protected StatelessHandleImpl | getHandle()
StatelessHandleImpl handle = new StatelessHandleImpl();
LocalBinding localBinding = (LocalBinding) advisor.resolveAnnotation(LocalBinding.class);
if (localBinding != null)
handle.jndiName = localBinding.jndiBinding();
return handle;
|
protected java.lang.Class[] | getInterfaces()
Class[] interfaces;
EJBContainer statelessContainer = (EJBContainer) container;
LocalHome localHome = (LocalHome) statelessContainer.resolveAnnotation(LocalHome.class);
boolean bindTogether = false;
if (localHome != null && bindHomeAndBusinessTogether(statelessContainer))
bindTogether = true;
Class[] localInterfaces = ProxyFactoryHelper.getLocalInterfaces(container);
if (bindTogether)
interfaces = new Class[localInterfaces.length + 3];
else
interfaces = new Class[localInterfaces.length + 2];
System.arraycopy(localInterfaces, 0, interfaces, 0, localInterfaces.length);
interfaces[localInterfaces.length] = JBossProxy.class;
interfaces[localInterfaces.length + 1] = javax.ejb.EJBLocalObject.class;
if (bindTogether)
interfaces[localInterfaces.length + 2] = localHome.value();
return interfaces;
|
protected void | initializeJndiName()
jndiName = ProxyFactoryHelper.getLocalJndiName(container);
|
public void | start()
super.start();
EJBContainer statelessContainer = (EJBContainer) container;
LocalHome localHome = (LocalHome) statelessContainer.resolveAnnotation(LocalHome.class);
if (localHome != null && !bindHomeAndBusinessTogether(statelessContainer))
{
Class[] interfaces = {localHome.value()};
Object homeProxy = java.lang.reflect.Proxy.newProxyInstance(container.getBeanClass().getClassLoader(),
interfaces, new StatelessLocalProxy(container));
NonSerializableFactory.rebind(container.getInitialContext(), ProxyFactoryHelper.getLocalHomeJndiName(container), homeProxy);
}
|
public void | stop()
super.stop();
EJBContainer statelessContainer = (EJBContainer) container;
LocalHome localHome = (LocalHome) statelessContainer.resolveAnnotation(LocalHome.class);
if (localHome != null && !bindHomeAndBusinessTogether(statelessContainer))
{
NonSerializableFactory.unbind(container.getInitialContext(), ProxyFactoryHelper.getLocalHomeJndiName(container));
}
|