private void validateMCF(ManagedConnectionFactory mcf, String raName) { _runtime.getConnectorBeanValidator().validateJavaBean(mcf, raName); }
private JavaEETransaction getCurrentTransaction() throws SystemException { JavaEETransactionManager txMgr = ConnectorRuntime.getRuntime().getTransactionManager(); return (JavaEETransaction) txMgr.getTransaction(); }
/** * {@inheritDoc} */ public synchronized void deployResource(Object resource) throws Exception { ResourceAdapterConfig domainConfig = (com.sun.enterprise.config.serverbeans.ResourceAdapterConfig) resource; String rarName = domainConfig.getResourceAdapterName(); ConnectorRuntime crt = ConnectorRuntime.getRuntime(); if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Calling backend to add resource adapterConfig ", rarName); } crt.addResourceAdapterConfig(rarName, domainConfig); if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Added resource adapterConfig in backend", rarName); } }
/** * initializes XATerminator reference */ private void initializeXATerminator() { if (xa == null) { xa = ConnectorRuntime.getRuntime().getXATerminatorProxy(moduleName); } } }
/** * Remove all the proxy objects (Work-Manager) from connector registry * * @param moduleName_ resource-adapter name */ private void removeProxiesFromRegistry(String moduleName_) { ConnectorRuntime.getRuntime().removeWorkManagerProxy(moduleName_); }
private ComponentEnvManager getComponentEnvManager() { return ConnectorRuntime.getRuntime().getComponentEnvManager(); }
if (getRuntime().isACCRuntime() || getRuntime().isNonACCRuntime()) { ConnectorDescriptor connectorDescriptor = null; connectorDescriptor = (ConnectorDescriptor) ic.lookup(descriptorJNDIName); try { getRuntime().createActiveResourceAdapter(connectorDescriptor, moduleName, null); } catch (ConnectorRuntimeException e) { if(_logger.isLoggable(Level.FINE)) { if (!getRuntime().checkAccessibility(moduleName, loader)) { String msg = localStrings.getString("cof.no_access_to_embedded_rar", moduleName); throw new NamingException(msg); ManagedConnectionFactory mcf = getRuntime().obtainManagedConnectionFactory(poolInfo, env); if (mcf == null) { if(_logger.isLoggable(Level.FINE)) { getRuntime().obtainConnectionManager(poolInfo, forceNoLazyAssoc, resourceInfo); mgr.setJndiName(derivedJndiName); mgr.setRarName(moduleName); if (getRuntime().isServer() || getRuntime().isEmbedded()) { ConnectorRegistry registry = ConnectorRegistry.getInstance(); if (registry.isTransparentDynamicReconfigPool(poolInfo)) { Resources resources = getRuntime().getResources(poolInfo); ResourcePool resourcePool = null; if (resources != null) { resourcePool = (ResourcePool) resources.getResourceByName(ResourcePool.class, poolInfo.getName()); if (resourcePool != null) {
public LocalTxConnectionEventListener(ResourceHandle resource) { this.resource = resource; this.associatedHandles = new IdentityHashMap(10); this.poolMgr = ConnectorRuntime.getRuntime().getPoolManager(); }
InvocationManager invmgr = ConnectorRuntime.getRuntime().getInvocationManager(); JavaEETransactionManager tm = ConnectorRuntime.getRuntime().getTransactionManager(); Transaction tran = null; try {
private Timer getTimer() { synchronized (getTimerLock) { if (timer == null) { ClassLoader loader = null; try { loader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader( ConnectorRuntime.getRuntime().getConnectorClassLoader()); timer = new Timer("connector-timer-proxy", true); } finally { Thread.currentThread().setContextClassLoader(loader); } } } return timer; }
ConnectorRuntime connectorRuntime = ConnectorRuntime.getRuntime(); ModuleDescriptor moduleDescriptor = null; Application application = null; if (connectorRuntime.isServer()) { loader = connectorRuntime.getSystemRARClassLoader(moduleName); connectorRuntime.getActiveRAFactory(). createActiveResourceAdapter(connectorDescriptor, moduleName, loader); if(_logger.isLoggable(Level.FINE)) { _logger.fine("ResourceAdapterAdminServiceImpl:: createActiveRA " + moduleName + " at " + moduleDir + " env =server ? " + (connectorRuntime.isServer())); if (connectorRuntime.isServer()) { + " publishing descriptor " + descriptorJNDIName); _runtime.getNamingManager().publishObject(descriptorJNDIName, connectorDescriptor, true); connectorRuntime.getSecurityPermissionSpec(moduleName);
JavaEETransactionManager tm = ConnectorRuntime.getRuntime().getTransactionManager(); Transaction tran = null; List invList = ConnectorRuntime.getRuntime().getInvocationManager().getAllInvocations(); PoolManager mgr = ConnectorRuntime.getRuntime().getPoolManager(); mgr.putbackDirectToPool( h, h.getResourceSpec().getPoolInfo()); _logger.log(Level.WARNING,
throws ResourceException { validateResourceAndPool(); PoolManager poolmgr = ConnectorRuntime.getRuntime().getPoolManager(); boolean resourceShareable = true; throw new ResourceException(msg); ConnectorRuntime.getRuntime().switchOnMatching(rarName, poolInfo); return internalGetConnection(mcf, null, cxRequestInfo, resourceShareable, jndiNameToUse, conn, false); Principal callerPrincipal = null; SecurityContext securityContext = null; ConnectorRuntime connectorRuntime = ConnectorRuntime.getRuntime(); if (connectorRuntime.isServer() && (securityContext = SecurityContext.getCurrent()) != null && (callerPrincipal = securityContext.getCallerPrincipal()) != null && (principalSet = securityContext.getPrincipalSet()) != null) { AuthenticationService authService = connectorRuntime.getAuthenticationService(rarName, poolInfo); if (authService != null) { prin = (ResourcePrincipal) authService.mapPrincipal( ConnectorRuntime.getRuntime().switchOnMatching(rarName, poolInfo);
/** * Remove the resource from book-keeping * * @param h ResourceHandle to be delisted * @throws javax.transaction.SystemException when not able to delist the resource */ private void enforceDelistment(ResourceHandle h) throws SystemException { JavaEETransaction txn = (JavaEETransaction) ConnectorRuntime.getRuntime().getTransaction(); if (txn != null) { Set set = txn.getResources(poolInfo); if (set != null) set.remove(h); } }
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); } } }
private ActiveInboundResourceAdapter getActiveResourceAdapter(String resourceAdapterMid) throws Exception { Object activeRar = registry_.getActiveResourceAdapter(resourceAdapterMid); // Except system-rars, all other rars are loaded eagerly. // Check whether the rar is a system-rar. // (as of now, jms-ra is the only inbound system-rar) if (activeRar == null && ConnectorsUtil.belongsToSystemRA(resourceAdapterMid)) { ConnectorRuntime crt = ConnectorRuntime.getRuntime(); crt.loadDeferredResourceAdapter(resourceAdapterMid); activeRar = registry_.getActiveResourceAdapter(resourceAdapterMid); } if (activeRar == null) { String msg = "Resource adapter " + resourceAdapterMid + " is not deployed"; throw new ConnectorRuntimeException(msg); } if (!(activeRar instanceof ActiveInboundResourceAdapter)) { throw new Exception("Resource Adapter selected doesn't support Inbound"); } return (ActiveInboundResourceAdapter) activeRar; }
ConnectorRuntime.getRuntime().getConnectorBeanValidator().validateJavaBean(adminObject, resadapter_);
ConnectorRuntime runtime = ConnectorRuntime.getRuntime(); ClassLoader loader ; if(ConnectorsUtil.belongsToSystemRA(rarModuleName)){ loader = ConnectorRuntime.getRuntime().getSystemRARClassLoader(rarModuleName); Thread.currentThread().setContextClassLoader(loader); }else{ loader = runtime.createConnectorClassLoader(moduleDir, null, rarModuleName); ConnectorArchivist connectorArchivist = runtime.getConnectorArchvist();
if (runtime.isACCRuntime() || runtime.isNonACCRuntime()) { ConnectorDescriptor connectorDescriptor = null; try { "ConnectorDescriptor from JNDI"); runtime.createActiveResourceAdapter(connectorDescriptor, moduleName, null); if (runtime.checkAccessibility(moduleName, loader) == false) { throw new NamingException("Only the application that has the embedded resource" + "adapter can access the resource adapter"); runtime.createActiveResourceAdapter(moduleLocation, moduleName, null); } else if(runtime.isServer()){ if(ConnectorsUtil.isStandAloneRA(moduleName) ){ loader = ConnectorRegistry.getInstance().getActiveResourceAdapter(moduleName).getClassLoader();
private ComponentInvocation getCurrentComponentInvocation() { return ConnectorRuntime.getRuntime().getInvocationManager().getCurrentInvocation(); }