/*
* In this implementation we just make a new Proxy Factory, for now
*/
// Initialize
StatefulSessionProxyFactory factory = null;
// If Clustered
if (this.isAnnotationPresent(Clustered.class))
{
// Get the Proxy Clustering Registry
Ejb3Registrar registrar = Ejb3RegistrarLocator.locateRegistrar();
String mcName = ClusteredObjectStoreBindings.CLUSTERED_OBJECTSTORE_BEAN_NAME_PROXY_CLUSTERING_REGISTRY;
ProxyClusteringRegistry registry = (ProxyClusteringRegistry) registrar.lookup(mcName);
assert registry != null : "Could not find " + ProxyClusteringRegistry.class.getSimpleName() + " in the "
+ Ejb3Registrar.class.getSimpleName() + " under name " + mcName;
factory = new StatefulSessionClusteredProxyFactory(this.getName(), this.getName(), Ejb3Registry.guid(this),
this.getMetaData(), this.getClassloader(), binding.clientBindUrl(), this.getAdvisor(), registry, null);
}
else
{
factory = new StatefulSessionRemoteProxyFactory(this.getName(), this.getName(), Ejb3Registry.guid(this), this
.getMetaData(), this.getClassloader(), binding.clientBindUrl(), this.getAdvisor(), null);
}
// Start the Factory
try
{
factory.start();
}
catch (Exception e)
{
throw new RuntimeException("Could not start " + factory, e);
}