public JRMPHelloServer(final String string) throws RemoteException { msg = string; try { clusteredObjectInfo = CMIInfoExtractor.extractClusteringInfoFromAnnotatedPOJO( "jrmpHelloServer", TestItf.class, JRMPHelloServer.class, false, null); } catch (CMIInfoExtractorException e) { // TODO Auto-generated catch block e.printStackTrace(); } } /**
throws CMIInfoExtractorException { org.ow2.cmi.info.mapping.Cluster clusteredObject = (org.ow2.cmi.info.mapping.Cluster) clusteredObj; String clusterName = clusteredObject.getClusterName(); if(clusterName == null || clusterName.equals("")) { clusterName = "defaultCluster"; boolean proxyEnabled = clusteredObject.isProxyEnabled(); String policyClassName = clusteredObject.getPolicyType(); Class<? extends IPolicy> policyClass = null; if(policyClassName != null && !policyClassName.equals("")) { } catch (ClassNotFoundException e) { logger.error("Cannot load the class {0} that define a policy", policyClassName, e); throw new CMIInfoExtractorException( "Cannot load the class " + policyClassName + " that define a policy", e); String strategyClassName = clusteredObject.getStrategyType(); Class<? extends IStrategy> strategyClass = null; if(strategyClassName != null && !strategyClassName.equals("")) { } catch (ClassNotFoundException e) { logger.error("Cannot load the class {0} that define a strategy", strategyClassName, e); throw new CMIInfoExtractorException( "Cannot load the class " + strategyClassName + " that define a strategy", e); IPoolConfiguration poolConfiguration = clusteredObject.getPoolConfiguration(); PropertiesInfo propertiesInfo = clusteredObject.getPropertiesInfo();
/** * Registers the dummy registry as an object to watch. * @throws ClientClusterViewManagerException */ private void initDataOfDummyRegistry() throws ClientClusterViewManagerException { String dummyName = getConfig().getDummyRegistryName(); ClusteredObjectInfo clusteredObjectInfo; // Extracts informations on clustering of dummy context try { clusteredObjectInfo = CMIInfoExtractor.extractClusteringInfoFromAnnotatedPOJO( dummyName, null, ClusteredDummyRegistry.class, false, null); } catch (CMIInfoExtractorException e) { LOGGER.error("Cannot get infos for dummy registry", e); throw new ClientClusterViewManagerException("Cannot get infos for dummy registry", e); } clientClusterViewCache.addClusteredObject( clusteredObjectInfo.getClusterName(), clusteredObjectInfo.isProxyEnabled(), dummyName, null, null, clusteredObjectInfo.hasState(), clusteredObjectInfo.getApplicationExceptionNames()); watch(dummyName); }
Class<?> itfClass = clusteredObjectInfo.getItfClass(); String businessName = null; String itfName = null; .getBusinessClass(); itfName = itfClass.getName(); .getPolicyType(); if (policyClass == null) { policyClass = FirstAvailable.class; .getStrategyType(); if (strategyClass == null) { strategyClass = NoStrategy.class; String clusterName = clusteredObjectInfo.getClusterName(); boolean proxyEnabled = clusteredObjectInfo.isProxyEnabled(); IPoolConfiguration poolConfiguration = clusteredObjectInfo.getPoolConfiguration(); if (poolConfiguration == null) { poolConfiguration = new PoolConfiguration(); Map<String, Object> properties = clusteredObjectInfo.getProperties(); boolean hasState = clusteredObjectInfo.hasState(); boolean replicated = clusteredObjectInfo.isReplicated(); Set<String> applicationExceptionNames = clusteredObjectInfo.getApplicationExceptionNames(); if (applicationExceptionNames == null) { applicationExceptionNames = new HashSet<String>();
try { if (cluster != null) { infos = CMIInfoExtractor.extractClusteringInfoFromClusteredObject(cluster, itfClass, beanClass, factory instanceof StatefulSessionFactory, false, applicationExceptionNames); } else { infos = CMIInfoExtractor.extractClusteringInfoFromAnnotatedPOJO( reference.getJNDINamingInfos().get(0).jndiName(), itfClass, beanClass, factory instanceof StatefulSessionFactory, applicationExceptionNames); CMIInfoRepository.addClusteredObjectInfo(reference.getJNDINamingInfos().get(0).jndiName(), infos); } catch (CMIInfoExtractorException e) { logger.error("Cannot extract infos for the class with name {0}", beanClass.getName(), e); CMIInfoRepository.removeClusteredObjectInfo(reference.getJNDINamingInfos().get(0).jndiName());
CMIMapping cmiMapping = new CMIMapping(); try { xmlConfiguration.configure(cmiMapping); } catch (XMLConfigurationException e) { logger.error("Cannot set informations for the clustered object with interface {0}", itfClass.getName(), e); throw new CMIInfoExtractorException( "Cannot set informations for the clustered object with interface " + itfClass.getName(), e); ClusteredObjects clusteredObjects = cmiMapping.getClusteredObjects(); logger.debug("Clustered objects found: {0}", clusteredObjects); for(org.ow2.cmi.info.mapping.Cluster clusteredObj : clusteredObjects.getClusteredObjects()) { if(clusteredObj.getObjectName() == null || clusteredObj.getObjectName().equals(objectName)) { clusteredObject = clusteredObj; break; throw new CMIInfoExtractorException("No definition of clustered object for " + objectName); return extractClusteringInfoFromClusteredObject( clusteredObject, itfClass, businessClass, stateful, replicated, applicationExceptionNames);
try { clusteredObjectInfo = CMIInfoExtractor.extractClusteringInfoFromAnnotatedPOJO(bindName, ClientClusterViewProvider.class, ClusteredClientClusterViewProvider.class, false, CMIInfoRepository.addClusteredObjectInfo(bindName, clusteredObjectInfo);
} else if(CMIInfoRepository.containClusteredObjectInfo(name)) { clusteredObjectInfo = CMIInfoRepository.getClusteredObjectInfo(name); } else { return; if(clusteredObjectInfo.isReplicated() && !((ServerClusterViewManager) clusterViewManager).isReplicationManagerStarted()) { LOGGER.warn(
CMIInfoExtractor.extractClusteringInfoFromAnnotatedPOJO( getConfig().getDummyRegistryName(), null, ClusteredDummyRegistry.class, false, null);
if(url != null) { try { return extractClusteringInfoFromDD( objectName, itfClass, null, url, stateful, replicated, applicationExceptionNames); propertyValue = PolicyFactory.convertString(policyType, propertyName, svalue); } catch (PropertyConfigurationException e) { throw new CMIInfoExtractorException("Cannot cast property " + propertyName, e); propertyValues = PolicyFactory.convertStrings(policyType, propertyName, Arrays.asList(svalues)); } catch (PropertyConfigurationException e) { throw new CMIInfoExtractorException("Cannot cast property " + propertyName, e); return new ClusteredObjectInfo( itfClass, null, clusterName, proxyEnabled, poolConfiguration,
clusteredObjectInfo = CMIInfoExtractor.extractClusteringInfoFromAnnotatedPOJO(providerName, ClientClusterViewProvider.class, ClusteredClientClusterViewProvider.class, false, null); } catch (CMIInfoExtractorException e) { Class<?> itfClass = clusteredObjectInfo.getItfClass(); Class<? extends EJBObject> businessClass = clusteredObjectInfo.getBusinessClass(); String businessName = null; if(businessClass != null) { clusteredObjectInfo.getClusterName(), clusteredObjectInfo.isProxyEnabled(), providerName, itfClass.getName(), businessName, clusteredObjectInfo.hasState(), clusteredObjectInfo.getApplicationExceptionNames()); Class<? extends IPolicy<?>> policyClass = clusteredObjectInfo.getPolicyType(); Class<? extends IStrategy<?>> strategyClass = clusteredObjectInfo.getStrategyType(); new PolicyData(policyClassname, strategyClassname, clusteredObjectInfo.getProperties()); clusteredObjectView.setPolicyData(policyDataForProvider); clientClusterViewCache.setPolicyClass(policyClassname, policyClass); pool.setPoolConfiguration(clusteredObjectInfo.getPoolConfiguration()); setPool(providerName, pool);
public IIOPHelloServer(final String string) throws RemoteException { msg = string; try { clusteredObjectInfo = CMIInfoExtractor.extractClusteringInfoFromAnnotatedPOJO( "iiopHelloServer", TestItf.class, IIOPHelloServer.class, false, null); } catch (CMIInfoExtractorException e) { // TODO Auto-generated catch block e.printStackTrace(); } }