Examples of ManagedExecutorService


Examples of org.glassfish.concurrent.config.ManagedExecutorService

            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

Examples of org.glassfish.concurrent.config.ManagedExecutorService

        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

Examples of org.glassfish.concurrent.config.ManagedExecutorService

        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);
        }
        if (contextInfo != null) {
            managedExecutorService.setContextInfo(contextInfo);
        }
        managedExecutorService.setThreadPriority(threadPriority);
        if (hungAfterSeconds != null) {
            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

Examples of org.glassfish.concurrent.config.ManagedExecutorService

            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

Examples of org.glassfish.concurrent.config.ManagedExecutorService

    // logger for this deployer
    private static Logger _logger = LogDomains.getLogger(ManagedExecutorServiceDeployer.class, LogDomains.RSR_LOGGER);

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

        if (managedExecutorServiceRes == null) {
            _logger.log(Level.INFO, "core.resourcedeploy_error");
            return;
        }

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

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


        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

Examples of org.glassfish.concurrent.config.ManagedExecutorService

        }
    }

    @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

Examples of org.glassfish.concurrent.config.ManagedExecutorService

        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

Examples of org.glassfish.concurrent.config.ManagedExecutorService

        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

Examples of org.jboss.as.clustering.ManagedExecutorService

            }
        }
        ExecutorService defaultExecutor = transportConfig.getDefaultExecutor();
        if (defaultExecutor != null) {
            if (!(transport.getDefaultThreadPool() instanceof ManagedExecutorService)) {
                transport.setDefaultThreadPool(new ManagedExecutorService(defaultExecutor));
            }
        }
        ExecutorService oobExecutor = transportConfig.getOOBExecutor();
        if (oobExecutor != null) {
            if (!(transport.getOOBThreadPool() instanceof ManagedExecutorService)) {
                transport.setOOBThreadPool(new ManagedExecutorService(oobExecutor));
            }
        }
        ScheduledExecutorService timerExecutor = transportConfig.getTimerExecutor();
        if (timerExecutor != null) {
            if (!(transport.getTimer() instanceof TimerSchedulerAdapter)) {
View Full Code Here

Examples of org.jboss.as.clustering.ManagedExecutorService

    public ExecutorService getExecutor(Properties properties) {
        Executor executor = (Executor) properties.get(EXECUTOR);
        if (executor == null) {
            throw new IllegalStateException(String.format("No %s property was specified within the executor properties: %s", EXECUTOR, properties));
        }
        return new ManagedExecutorService(executor);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.