/** * create the service, do expensive operations etc */ public void create () throws Exception { BeanMetaData bmd = con.getBeanMetaData(); ClusterConfigMetaData ccmd = bmd.getClusterConfigMetaData (); String partitionName = ccmd.getPartitionName(); String name = "jboss:service=DistributedState,partitionName="+partitionName; ds = (DistributedState)org.jboss.system.Registry.lookup (name); String ejbName = bmd.getEjbName(); this.DS_CATEGORY = "CMPClusteredInMemoryPersistenceManager-" + ejbName; idField = con.getBeanClass ().getField ("id"); try { isModified = con.getBeanClass ().getMethod ("isModified", new Class[0]); if (!isModified.getReturnType ().equals (Boolean.TYPE)) isModified = null; // Has to have "boolean" as return type! } catch (NoSuchMethodException ignored) { } }
protected void createService() throws Exception { // Initialize the dataStore // Find HASessionState that we will use // String sessionStateName = org.jboss.metadata.ClusterConfigMetaData.DEFAULT_SESSION_STATE_NAME; ClusterConfigMetaData config = con.getBeanMetaData ().getClusterConfigMetaData (); if (config != null) sessionStateName = config.getHaSessionStateName (); Context ctx = new InitialContext (); try { this.sessionState = (HASessionState)ctx.lookup (sessionStateName); } finally { ctx.close(); } this.localNodeName = this.sessionState.getNodeName (); this.appName = this.con.getBeanMetaData ().getJndiName (); this.sessionState.subscribe (this.appName, this); }
protected void setupInvokers() throws Exception String partitionName = container.getBeanMetaData().getClusterConfigMetaData().getPartitionName(); HAPartition partition = HAPartitionLocator.getHAPartitionLocator().getHAPartition(partitionName, null); this.drm = partition.getDistributedReplicantManager (); LoadBalancePolicy policy; clazz = cl.loadClass(container.getBeanMetaData().getClusterConfigMetaData().getHomeLoadBalancePolicy()); policy = (LoadBalancePolicy)clazz.newInstance(); homeInvoker = jrmp.createProxy(jmxName, policy, clusterFamilyName + "H"); ); clazz = cl.loadClass(container.getBeanMetaData().getClusterConfigMetaData().getBeanLoadBalancePolicy()); policy = (LoadBalancePolicy)clazz.newInstance(); beanInvoker = jrmp.createProxy(jmxName, policy, clusterFamilyName + "R");
public void create() throws Exception { super.create (); // Get a reference to the DS service ClusterConfigMetaData config = getContainer().getBeanMetaData().getClusterConfigMetaData(); String partitionName = config.getPartitionName(); String name = "jboss:service=DistributedState,partitionName=" + partitionName; ds = (DistributedState) Registry.lookup (name); if( ds == null ) throw new DeploymentException("Failed to find DistributedState service: "+name); }