Package org.glassfish.resources.config

Examples of org.glassfish.resources.config.CustomResource


    /**
     * {@inheritDoc}
     */
    public synchronized void deployResource(Object resource, String applicationName, String moduleName)
            throws Exception {
        CustomResource customResource =
                (CustomResource) resource;
        ResourceInfo resourceInfo = new ResourceInfo(customResource.getJndiName(), applicationName, moduleName);
        deployResource(resource, resourceInfo);
    }
View Full Code Here


    /**
     * {@inheritDoc}
     */
    public synchronized void deployResource(Object resource) throws Exception {
        CustomResource customResource =
                (CustomResource) resource;
        ResourceInfo resourceInfo = ResourceUtil.getResourceInfo(customResource);
        deployResource(customResource, resourceInfo);
    }
View Full Code Here

        deployResource(customResource, resourceInfo);
    }

    private void deployResource(Object resource, ResourceInfo resourceInfo) {

        CustomResource customRes =
                (CustomResource) resource;

        // converts the config data to j2ee resource
        JavaEEResource j2eeResource = toCustomJavaEEResource(customRes, resourceInfo);
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void undeployResource(Object resource, String applicationName, String moduleName) throws Exception {
        CustomResource customResource =
                (CustomResource) resource;
        ResourceInfo resourceInfo = new ResourceInfo(customResource.getJndiName(), applicationName, moduleName);
        deleteResource(customResource, resourceInfo);
    }
View Full Code Here

     * {@inheritDoc}
     */
    public synchronized void undeployResource(Object resource)
            throws Exception {

        CustomResource customResource =
                (CustomResource) resource;
        ResourceInfo resourceInfo = ResourceUtil.getResourceInfo(customResource);
        deleteResource(customResource, resourceInfo);
    }
View Full Code Here

            // delete custom-resource
            ConfigSupport.apply(new SingleConfigCode<Resources>() {

                public Object run(Resources param) throws PropertyVetoException,
                        TransactionFailure {
                    CustomResource resource = (CustomResource)
                            domain.getResources().getResourceByName(CustomResource.class, jndiName);
                        if (resource != null && resource.getJndiName().equals(jndiName)) {
                            return param.getResources().remove(resource);
                        }
                    return null;
                }
            }, domain.getResources());
View Full Code Here

            // delete custom-resource
            ConfigSupport.apply(new SingleConfigCode<Resources>() {

                public Object run(Resources param) throws PropertyVetoException,
                        TransactionFailure {
                    CustomResource resource = (CustomResource)
                            domain.getResources().getResourceByName(CustomResource.class, jndiName);
                        if (resource != null && resource.getJndiName().equals(jndiName)) {
                            return param.getResources().remove(resource);
                        }
                    return null;
                }
            }, domain.getResources());
View Full Code Here

        description = (String) attributes.get(DESCRIPTION);
    }

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

        return newResource;
    }

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

TOP

Related Classes of org.glassfish.resources.config.CustomResource

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.