Package org.glassfish.concurrent.config

Examples of org.glassfish.concurrent.config.ManagedExecutorService$ManagedExecutorServiceConfigActivator


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

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


        return newResource;
    }

    protected ManagedExecutorService createConfigBean(Resources param, Properties properties) throws PropertyVetoException,
            TransactionFailure {
        ManagedExecutorService managedExecutorService = null;
        if (getResourceType().equals(ServerTags.MANAGED_EXECUTOR_SERVICE)) {
            managedExecutorService = param.createChild(ManagedExecutorService.class);
        } else {
            managedExecutorService = param.createChild(ManagedScheduledExecutorService.class);
        }
        managedExecutorService.setJndiName(jndiName);
        if (description != null) {
            managedExecutorService.setDescription(description);
        }
        managedExecutorService.setContextInfoEnabled(contextInfoEnabled);
        managedExecutorService.setContextInfo(contextInfo);
        managedExecutorService.setThreadPriority(threadPriority);
        managedExecutorService.setHungAfterSeconds(hungAfterSeconds);
        managedExecutorService.setCorePoolSize(corePoolSize);
        managedExecutorService.setMaximumPoolSize(maximumPoolSize);
        managedExecutorService.setKeepAliveSeconds(keepAliveSeconds);
        managedExecutorService.setThreadLifetimeSeconds(threadLifetimeSeconds);
        managedExecutorService.setTaskQueueCapacity(taskQueueCapacity);
        managedExecutorService.setEnabled(enabled);
        if (properties != null) {
            for ( Map.Entry e : properties.entrySet()) {
                Property prop = managedExecutorService.createChild(Property.class);
                prop.setName((String)e.getKey());
                prop.setValue((String)e.getValue());
                managedExecutorService.getProperty().add(prop);
            }
        }
        return managedExecutorService;
    }
View Full Code Here

            resourceUtil.deleteResourceRef(jndiName, target);
           
            // delete managed executor service
            if (ConfigSupport.apply(new SingleConfigCode<Resources>() {
                public Object run(Resources param) throws PropertyVetoException, TransactionFailure {
                    ManagedExecutorService resource = null;
                    if (getResourceType().equals(ServerTags.MANAGED_EXECUTOR_SERVICE)) {
                        resource = (ManagedExecutorService) ConnectorsUtil.getResourceByName(resources, ManagedExecutorService.class, jndiName);
                    } else {
                        resource = (ManagedScheduledExecutorService) ConnectorsUtil.getResourceByName(resources, ManagedScheduledExecutorService.class, jndiName);
                    }
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 {
        ManagedExecutorService managedExecutorServiceRes = (ManagedExecutorService) resource;

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

        String jndiName = managedExecutorServiceRes.getJndiName();

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


        ResourceInfo resourceInfo = new ResourceInfo(managedExecutorServiceRes.getJndiName(), applicationName, moduleName);
        ManagedExecutorServiceConfig config = new ManagedExecutorServiceConfig(managedExecutorServiceRes);

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

        }
    }

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

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

    @Override
    public void undeployResource(Object resource) throws Exception {
        ManagedExecutorService managedExecutorServiceResource =
                (ManagedExecutorService) resource;
        ResourceInfo resourceInfo = ResourceUtil.getResourceInfo(managedExecutorServiceResource);
        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 {
        ManagedExecutorService managedExecutorServiceRes = (ManagedExecutorService) resource;
        ResourceInfo resourceInfo = new ResourceInfo(managedExecutorServiceRes.getJndiName(), applicationName, moduleName);
        namingService.unpublishObject(resourceInfo, managedExecutorServiceRes.getJndiName());
        // stop the runtime object
        concurrentRuntime.shutdownManagedExecutorService(managedExecutorServiceRes.getJndiName());
    }
View Full Code Here

        return super.isValid(resources, validateResourceRef, target);
    }

    protected ManagedExecutorServiceBase createConfigBean(Resources param, Properties properties) throws PropertyVetoException, TransactionFailure {
        ManagedExecutorService managedExecutorService = param.createChild(ManagedExecutorService.class);
        setAttributesOnConfigBean(managedExecutorService, properties);
        managedExecutorService.setMaximumPoolSize(maximumPoolSize);
        managedExecutorService.setTaskQueueCapacity(taskQueueCapacity);
        return managedExecutorService;
    }
View Full Code Here

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

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

        return newResource;
    }

    protected ManagedExecutorService createConfigBean(Resources param, Properties properties) throws PropertyVetoException,
            TransactionFailure {
        ManagedExecutorService managedExecutorService = null;
        if (getResourceType().equals(ServerTags.MANAGED_EXECUTOR_SERVICE)) {
            managedExecutorService = param.createChild(ManagedExecutorService.class);
        } else {
            managedExecutorService = param.createChild(ManagedScheduledExecutorService.class);
        }
        managedExecutorService.setJndiName(jndiName);
        if (description != null) {
            managedExecutorService.setDescription(description);
        }
        managedExecutorService.setContextInfoEnabled(contextInfoEnabled);
        managedExecutorService.setContextInfo(contextInfo);
        managedExecutorService.setThreadPriority(threadPriority);
        managedExecutorService.setHungAfterSeconds(hungAfterSeconds);
        managedExecutorService.setCorePoolSize(corePoolSize);
        managedExecutorService.setMaximumPoolSize(maximumPoolSize);
        managedExecutorService.setKeepAliveSeconds(keepAliveSeconds);
        managedExecutorService.setThreadLifetimeSeconds(threadLifetimeSeconds);
        managedExecutorService.setTaskQueueCapacity(taskQueueCapacity);
        managedExecutorService.setEnabled(enabled);
        if (properties != null) {
            for ( Map.Entry e : properties.entrySet()) {
                Property prop = managedExecutorService.createChild(Property.class);
                prop.setName((String)e.getKey());
                prop.setValue((String)e.getValue());
                managedExecutorService.getProperty().add(prop);
            }
        }
        return managedExecutorService;
    }
View Full Code Here

TOP

Related Classes of org.glassfish.concurrent.config.ManagedExecutorService$ManagedExecutorServiceConfigActivator

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.