private void unregisterBeanValidator(String rarName){ ConnectorRegistry registry = ConnectorRegistry.getInstance(); registry.removeBeanValidator(rarName); }
/** * Undeploy the resource from the server's runtime naming context * * @param resource a resource object * @throws UnsupportedOperationException Currently we are not supporting this method. */ private synchronized void actualUndeployResource(PoolInfo poolInfo) throws Exception { runtime.deleteConnectorConnectionPool(poolInfo); //performance issue related fix : IT 15784 ConnectorRegistry.getInstance().removeTransparentDynamicReconfigPool(poolInfo); if (_logger.isLoggable(Level.FINEST)) { _logger.finest("Pool Undeployed"); } }
private Validator getBeanValidator(String rarName) { Validator beanValidator = ConnectorRegistry.getInstance().getBeanValidator(rarName); ValidatorFactory validatorFactory = null; // this is needed in case of appclient/standalone client // and system-resource-adapters in server. if (beanValidator == null) { ClassLoader contextCL = null; try{ contextCL = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(ConnectorRuntime.getRuntime().getConnectorClassLoader()); validatorFactory = Validation.byDefaultProvider().configure().buildValidatorFactory(); beanValidator = validatorFactory.getValidator(); ConnectorRegistry.getInstance().addBeanValidator(rarName, beanValidator); }finally{ Thread.currentThread().setContextClassLoader(contextCL); } } return beanValidator; } }
private void registerTransparentDynamicReconfigPool(PoolInfo poolInfo, JdbcConnectionPool resourcePool) { ConnectorRegistry registry = ConnectorRegistry.getInstance(); if(ConnectorsUtil.isDynamicReconfigurationEnabled(resourcePool)){ registry.addTransparentDynamicReconfigPool(poolInfo); }else{ registry.removeTransparentDynamicReconfigPool(poolInfo); } }
public java.lang.Object run() throws Exception { String module = ConnectorConstants.DEFAULT_JMS_ADAPTER; String loc = ConnectorsUtil.getSystemModuleLocation(module); connectorRuntime.createActiveResourceAdapter(loc, module, null); return (ActiveJmsResourceAdapter) ConnectorRegistry.getInstance(). getActiveResourceAdapter(module); } });
public void createEmptyConnectionPool(PoolInfo poolInfo, PoolType pt, Hashtable env) throws PoolingException { //Create and initialise the connection pool createAndInitPool(poolInfo, pt, env); if (listener != null) { try { listener.poolCreated(poolInfo); } catch (Exception ex) { if(_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Exception thrown on pool listener"); } } } //notify mcf-create ManagedConnectionFactory mcf = ConnectorRegistry.getInstance().getManagedConnectionFactory(poolInfo); if(mcf != null){ if(mcf instanceof MCFLifecycleListener){ ((MCFLifecycleListener)mcf).mcfCreated(); } } }
/** * Kill the pool with the specified pool name * * @param poolInfo - The name of the pool to kill */ public void killPool(PoolInfo poolInfo) { //empty the pool //and remove from poolTable ResourcePool pool = poolTable.get(poolInfo); if (pool != null) { pool.cancelResizerTask(); pool.emptyPool(); if (_logger.isLoggable(Level.FINE)) { _logger.fine("Removing pool " + pool + " from pooltable"); } synchronized (poolTable) { poolTable.remove(poolInfo); } if (listener != null){ listener.poolDestroyed(poolInfo); } //notify mcf-destroy ManagedConnectionFactory mcf = ConnectorRegistry.getInstance().getManagedConnectionFactory(poolInfo); if(mcf != null){ if(mcf instanceof MCFLifecycleListener){ ((MCFLifecycleListener)mcf).mcfDestroyed(); } } } }
ConnectorRegistry.getInstance().getResourceAdapterConfig(moduleName);
}else{ ConnectorApplication app = ConnectorRegistry.getInstance().getConnectorApplication(resourceAdapterName);
/** * associates the given instance of ResourceAdapterAssociation with * the ResourceAdapter java-bean of the specified RAR * @param rarName resource-adapter-name * @param raa Object that is an instance of ResourceAdapterAssociation * @throws ResourceException when unable to associate the RA Bean with RAA instance. */ public void associateResourceAdapter(String rarName, ResourceAdapterAssociation raa) throws ResourceException { ResourceAdapter ra = ConnectorRegistry.getInstance(). getActiveResourceAdapter(rarName).getResourceAdapter(); if(ra != null){ raa.setResourceAdapter(ra); }else{ throw new ResourceException("RA Bean [ "+rarName+" ] not available"); } }
try { if (associateResourceAdapter) { ActiveResourceAdapter activeRA = ConnectorRegistry.getInstance(). getActiveResourceAdapter(resourceAdapterName); if (activeRA == null) { activeRA = ConnectorRegistry.getInstance(). getActiveResourceAdapter(resourceAdapterName);
public void initialize() throws ConnectorRuntimeException { ConnectorRuntime runtime = ConnectorRuntime.getRuntime(); if(runtime.isNonACCRuntime()){ jndiName = ConnectorsUtil.getPMJndiName(jndiName); } ConnectorRegistry registry = ConnectorRegistry.getInstance(); PoolMetaData pmd = registry.getPoolMetaData(poolInfo); defaultPrin = pmd.getResourcePrincipal(); }
/** * Loads RA javabean. This method is protected, so that any system * resource adapter can have specific configuration done during the * loading. * * @throws ConnectorRuntimeException if there is a failure. */ protected void loadRAConfiguration() throws ConnectorRuntimeException { try { Set mergedProps; ConnectorRegistry registry = ConnectorRegistry.getInstance(); ResourceAdapterConfig raConfig = registry.getResourceAdapterConfig(moduleName_); List<Property> raConfigProps = new ArrayList<Property>(); mergedProps = mergeRAConfiguration(raConfig, raConfigProps); logMergedProperties(mergedProps); SetMethodAction setMethodAction = new SetMethodAction(this.resourceadapter_, mergedProps); setMethodAction.run(); } catch (Exception e) { String i18nMsg = localStrings.getString("ccp_adm.wrong_params_for_create", e.getMessage()); ConnectorRuntimeException cre = new ConnectorRuntimeException(i18nMsg); cre.initCause(e); throw cre; } }
/** * Creates an instance of <code>ConnectorMessageBeanClient</code> * * @param descriptor <code>EjbMessageBeanDescriptor</code> object. */ public ConnectorMessageBeanClient(EjbMessageBeanDescriptor descriptor) { this.descriptor_ = descriptor; allocator_ = new BasicResourceAllocator(); String appName = descriptor.getApplication().getName(); String moduleID = descriptor.getEjbBundleDescriptor().getModuleID(); String beanName = descriptor.getName(); activationName = null; beanID_ = appName + ":" + moduleID + ":" + beanName; registry_ = ConnectorRegistry.getInstance(); }
ResourceAdapter ra = ConnectorRegistry.getInstance(). getActiveResourceAdapter(resadapter_).getResourceAdapter(); ((ResourceAdapterAssociation) adminObject).setResourceAdapter(ra);
private void createActiveResourceAdapter(String rarModuleName) throws ConnectorRuntimeException { ConnectorRuntime cr = connectorRuntimeProvider.get(); ConnectorRegistry creg = ConnectorRegistry.getInstance(); if (creg.isRegistered(rarModuleName)) return; if (ConnectorAdminServiceUtils.isEmbeddedConnectorModule(rarModuleName)) { cr.createActiveResourceAdapterForEmbeddedRar(rarModuleName); } else { String moduleDir ; if (ConnectorsUtil.belongsToSystemRA(rarModuleName)) { moduleDir = ConnectorsUtil.getSystemModuleLocation(rarModuleName); }else{ moduleDir = configBeansUtilities.getLocation(rarModuleName); } ClassLoader loader = cr.createConnectorClassLoader(moduleDir, null, rarModuleName); cr.createActiveResourceAdapter(moduleDir, rarModuleName, loader); } }
private void handlePoolRecreationForExistingProxies(ConnectorConnectionPool connConnPool) { recreatePool(connConnPool); Collection<BindableResource> resourcesList ; if(!connConnPool.isApplicationScopedResource()){ resourcesList = domain.getResources().getResourcesOfPool(connConnPool.getName()); }else{ PoolInfo poolInfo = connConnPool.getPoolInfo(); Resources resources = ResourcesUtil.createInstance().getResources(poolInfo); resourcesList = resources.getResourcesOfPool(connConnPool.getName()); } for (BindableResource bindableResource : resourcesList) { ResourceInfo resourceInfo = ConnectorsUtil.getResourceInfo(bindableResource); Map<DynamicallyReconfigurableResource, Boolean> connectionFactories = ConnectorRegistry.getInstance().getResourceFactories(resourceInfo); debug("marking connection factories for refresh"); for (DynamicallyReconfigurableResource cf : connectionFactories.keySet()) { debug("marking connection factory for refresh : " + cf); connectionFactories.put(cf, Boolean.valueOf("false")); } } }
private void deleteResource(JdbcResource jdbcResource, ResourceInfo resourceInfo) throws Exception { if (ResourcesUtil.createInstance().isEnabled(jdbcResource, resourceInfo)) { runtime.deleteConnectorResource(resourceInfo); ConnectorRegistry.getInstance().removeResourceFactories(resourceInfo); //In-case the resource is explicitly created with a suffix (__nontx or __PM), no need to delete one if (ConnectorsUtil.getValidSuffix(resourceInfo.getName()) == null) { String pmJndiName = ConnectorsUtil.getPMJndiName(resourceInfo.getName()); ResourceInfo pmResourceInfo = new ResourceInfo(pmJndiName, resourceInfo.getApplicationName(), resourceInfo.getModuleName()); runtime.deleteConnectorResource(pmResourceInfo); ConnectorRegistry.getInstance().removeResourceFactories(pmResourceInfo); } //Since 8.1 PE/SE/EE - if no more resource-ref to the pool //of this resource in this server instance, remove pool from connector //runtime checkAndDeletePool(jdbcResource); } else { _logger.log(Level.FINEST, "core.resource_disabled", new Object[]{jdbcResource.getJndiName(), ConnectorConstants.RES_TYPE_JDBC}); } }
public static ConnectionManager getAvailableConnectionManager( PoolInfo poolInfo, boolean forceNoLazyAssoc, ResourceInfo resourceInfo) throws ConnectorRuntimeException { ConnectorRegistry registry = ConnectorRegistry.getInstance(); PoolMetaData pmd = registry.getPoolMetaData(poolInfo); boolean isLazyEnlist = pmd.isLazyEnlistable(); boolean isLazyAssoc = pmd.isLazyAssociatable(); ConnectionManagerImpl mgr = null; if (isLazyAssoc && !forceNoLazyAssoc) { logFine("Creating LazyAssociatableConnectionManager"); mgr = new LazyAssociatableConnectionManagerImpl(poolInfo, resourceInfo); }else if (isLazyEnlist) { logFine("Creating LazyEnlistableConnectionManager"); mgr = new LazyEnlistableConnectionManagerImpl(poolInfo, resourceInfo); } else { logFine("Creating plain ConnectionManager"); mgr = new ConnectionManagerImpl(poolInfo, resourceInfo); } return mgr; }
private void createActiveResourceAdapter(String rarModuleName) throws ConnectorRuntimeException { ConnectorRuntime cr = ConnectorRuntime.getRuntime(); ConnectorRegistry creg = ConnectorRegistry.getInstance(); if (creg.isRegistered(rarModuleName)) return; if (ConnectorAdminServiceUtils.isEmbeddedConnectorModule(rarModuleName)) { cr.createActiveResourceAdapterForEmbeddedRar(rarModuleName); } else { String moduleDir ; if (ConnectorsUtil.belongsToSystemRA(rarModuleName)) { moduleDir = ConnectorsUtil.getSystemModuleLocation(rarModuleName); }else{ moduleDir = ConfigBeansUtilities.getLocation(rarModuleName); } ClassLoader loader = cr.createConnectorClassLoader(moduleDir, null, rarModuleName); cr.createActiveResourceAdapter(moduleDir, rarModuleName, loader); } } }