Package org.glassfish.concurrent.config

Examples of org.glassfish.concurrent.config.ContextService$ContextServiceConfigActivator


        enabledValueForTarget = (String) attributes.get(ENABLED);
    }

    private ContextService createResource(Resources param, Properties properties) throws PropertyVetoException,
            TransactionFailure {
        ContextService newResource = createConfigBean(param, properties);
        param.getResources().add(newResource);
        return newResource;
    }
View Full Code Here


        return newResource;
    }

    private ContextService createConfigBean(Resources param, Properties properties) throws PropertyVetoException,
            TransactionFailure {
        ContextService contextService = param.createChild(ContextService.class);
        contextService.setJndiName(jndiName);
        if (description != null) {
            contextService.setDescription(description);
        }
        contextService.setContextInfoEnabled(contextInfoEnabled);
        contextService.setContextInfo(contextInfo);
        contextService.setEnabled(enabled);
        if (properties != null) {
            for ( Map.Entry e : properties.entrySet()) {
                Property prop = contextService.createChild(Property.class);
                prop.setName((String)e.getKey());
                prop.setValue((String)e.getValue());
                contextService.getProperty().add(prop);
            }
        }
        return contextService;
    }
View Full Code Here

            resourceUtil.deleteResourceRef(jndiName, target);
           
            // delete context-service
            if (ConfigSupport.apply(new SingleConfigCode<Resources>() {
                public Object run(Resources param) throws PropertyVetoException, TransactionFailure {
                    ContextService resource = (ContextService) ConnectorsUtil.getResourceByName(resources, ContextService.class, jndiName);
                    return param.getResources().remove(resource);
                }
            }, resources) == null) {
                String msg = localStrings.getLocalString("delete.context.service.failed", "Context service {0} deletion failed", jndiName);
                return new ResourceStatus(ResourceStatus.FAILURE, msg);
View Full Code Here

    // logger for this deployer
    private static Logger _logger = LogFacade.getLogger();

    @Override
    public void deployResource(Object resource, String applicationName, String moduleName) throws Exception {
        ContextService contextServiceRes = (ContextService) resource;

        if (contextServiceRes == null) {
            _logger.log(Level.WARNING, LogFacade.DEPLOY_ERROR_NULL_CONFIG, "ContextService");
            return;
        }

        String jndiName = contextServiceRes.getJndiName();
        String contextInfo = contextServiceRes.getContextInfo();

        if(_logger.isLoggable(Level.FINE)) {
            _logger.log(Level.FINE, "ContextServiceDeployer.deployResource() : jndi-name ["+jndiName+"], " +
                    " context-info ["+contextInfo+"]");
        }


        ResourceInfo resourceInfo = new ResourceInfo(contextServiceRes.getJndiName(), applicationName, moduleName);
        ContextServiceConfig config = new ContextServiceConfig(contextServiceRes);

        javax.naming.Reference ref= new  javax.naming.Reference(
                javax.enterprise.concurrent.ContextService.class.getName(),
                "org.glassfish.concurrent.runtime.deployer.ConcurrentObjectFactory",
View Full Code Here

        }
    }

    @Override
    public void deployResource(Object resource) throws Exception {
        ContextService contextServiceResource =
                (ContextService) resource;
        ResourceInfo resourceInfo = ResourceUtil.getResourceInfo(contextServiceResource);
        deployResource(resource, resourceInfo.getApplicationName(), resourceInfo.getModuleName());
    }
View Full Code Here

        deployResource(resource, resourceInfo.getApplicationName(), resourceInfo.getModuleName());
    }

    @Override
    public void undeployResource(Object resource) throws Exception {
        ContextService contextServiceResource =
                (ContextService) resource;
        ResourceInfo resourceInfo = ResourceUtil.getResourceInfo(contextServiceResource);
        undeployResource(resource, resourceInfo.getApplicationName(), resourceInfo.getModuleName());
    }
View Full Code Here

        undeployResource(resource, resourceInfo.getApplicationName(), resourceInfo.getModuleName());
    }

    @Override
    public void undeployResource(Object resource, String applicationName, String moduleName) throws Exception {
        ContextService contextServiceRes = (ContextService) resource;
        ResourceInfo resourceInfo = new ResourceInfo(contextServiceRes.getJndiName(), applicationName, moduleName);
        namingService.unpublishObject(resourceInfo, contextServiceRes.getJndiName());
        // stop the runtime object
        concurrentRuntime.shutdownContextService(contextServiceRes.getJndiName());
    }
View Full Code Here

        enabledValueForTarget = (String) attributes.get(ENABLED);
    }

    private ContextService createResource(Resources param, Properties properties) throws PropertyVetoException,
            TransactionFailure {
        ContextService newResource = createConfigBean(param, properties);
        param.getResources().add(newResource);
        return newResource;
    }
View Full Code Here

        return newResource;
    }

    private ContextService createConfigBean(Resources param, Properties properties) throws PropertyVetoException,
            TransactionFailure {
        ContextService contextService = param.createChild(ContextService.class);
        contextService.setJndiName(jndiName);
        if (description != null) {
            contextService.setDescription(description);
        }
        contextService.setContextInfoEnabled(contextInfoEnabled);
        contextService.setContextInfo(contextInfo);
        contextService.setEnabled(enabled);
        if (properties != null) {
            for ( Map.Entry e : properties.entrySet()) {
                Property prop = contextService.createChild(Property.class);
                prop.setName((String)e.getKey());
                prop.setValue((String)e.getValue());
                contextService.getProperty().add(prop);
            }
        }
        return contextService;
    }
View Full Code Here

            resourceUtil.deleteResourceRef(jndiName, target);
           
            // delete context-service
            if (ConfigSupport.apply(new SingleConfigCode<Resources>() {
                public Object run(Resources param) throws PropertyVetoException, TransactionFailure {
                    ContextService resource = (ContextService) ConnectorsUtil.getResourceByName(resources, ContextService.class, jndiName);
                    return param.getResources().remove(resource);
                }
            }, resources) == null) {
                String msg = localStrings.getLocalString("delete.context.service.failed", "Context service {0} deletion failed", jndiName);
                return new ResourceStatus(ResourceStatus.FAILURE, msg);
View Full Code Here

TOP

Related Classes of org.glassfish.concurrent.config.ContextService$ContextServiceConfigActivator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.