deployer.deployResource(resource);
private void deployServerResource(Resource resource) { ResourceDeployer deployer = getResourceDeployer(resource); if (deployer == null) { logger.log( Level.WARNING, ResourceLoggingConstansts.UNABLE_TO_FIND_RESOURCEDEPLOYER, new Object[] { resource.getIdentity() } ); return; } try { if (isServerResourceEnabled(resource, deployer)) { deployer.deployResource(resource); // deploy the resource; should be a no-op on the deployer if already deployed } else if (isServerResourceDeployed(resource)) { deployer.undeployResource(resource); // resource is not enabled in the config, undeploy it if the resource is already deployed } } catch (Exception e) { Object[] params = { ResourceUtil.getGenericResourceInfo(resource), e }; logger.log( Level.WARNING, ResourceLoggingConstansts.UNABLE_TO_DEPLOY, params); } }
public synchronized Object create(Context ic) throws NamingException { if (actualResourceName == null) { actualResourceName = ConnectorsUtil.deriveResourceName (desc.getResourceId(), desc.getName(), desc.getResourceType()); try { if (serviceLocator == null) { serviceLocator = Globals.getDefaultHabitat(); if (serviceLocator == null) { throw new NamingException("Unable to create resource " + "[" + desc.getName() + " ] as habitat is null"); } } getResourceDeployer(desc).deployResource(desc); } catch (Exception e) { NamingException ne = new NamingException("Unable to create resource [" + desc.getName() + " ]"); ne.initCause(e); throw ne; } } return ic.lookup(actualResourceName); }
getResourceDeployer(desc).deployResource(desc); } catch (Exception e) { NamingException ne = new NamingException("Unable to create resource [" + desc.getName() + " ]");
ResourceDeployer deployer = getResourceDeployer(instance); if (deployer != null) deployer.deployResource(instance); } catch (Exception e) { Object params[] = {ResourceUtil.getGenericResourceInfo((Resource) instance), e};
public Object create(Context ic) throws NamingException { //this is a per-lookup object and once we have the resource, //we remove the proxy and bind the resource (ref) with same jndi-name //hence block synchronization is fine as it blocks only callers //of this particular resource and also only for first time (initialization) synchronized(this){ try{ if(result == null){ getResourceDeployer(resource).deployResource(resource, resourceInfo.getApplicationName(), resourceInfo.getModuleName()); } result = namingService.lookup(resourceInfo, resourceInfo.getName(), ic.getEnvironment()); }catch(Exception e){ throwResourceNotFoundException(e, resourceInfo); } } return result; }
ResourceDeployer deployer = getResourceDeployer(resource); if (deployer != null) deployer.deployResource(resource); } catch (Exception e) { Object[] params = {ResourceUtil.getGenericResourceInfo(resource), e};
public void deployResources(String applicationName, String moduleName, Collection<com.sun.enterprise.config.serverbeans.Resource> resources, boolean postDeployPhase) throws Exception { for(Resource resource : resources){ if(resource instanceof BindableResource) { BindableResource bindableResource = (BindableResource)resource; ResourceInfo resourceInfo = new ResourceInfo(bindableResource.getJndiName(), applicationName, moduleName); if(getResourceDeployer(bindableResource).canDeploy(postDeployPhase, resources, bindableResource)){ resourcesBinder.deployResource(resourceInfo, bindableResource); } } else{ if(getResourceDeployer(resource).canDeploy(postDeployPhase, resources, resource)){ getResourceDeployer(resource).deployResource(resource, applicationName, moduleName); } } } }