Examples of CustomResource


Examples of com.sun.enterprise.resource.beans.CustomResource

     */
    public static JavaEEResource toCustomJavaEEResource(
            com.sun.enterprise.config.serverbeans.CustomResource rbean, ResourceInfo resourceInfo) {


        CustomResource jr = new CustomResource(resourceInfo);

        //jr.setDescription(rbean.getDescription()); // FIXME: getting error

        // sets the enable flag
        jr.setEnabled( ConnectorsUtil.parseBoolean(rbean.getEnabled()) );

        // sets the resource type
        jr.setResType( rbean.getResType() );

        // sets the factory class name
        jr.setFactoryClass( rbean.getFactoryClass() );

        // sets the properties
        List<Property> properties = rbean.getProperty();
        if (properties!= null) {
            for(Property property : properties) {
                ResourceProperty rp =
                    new ResourcePropertyImpl(property.getName(), property.getValue());
                jr.addProperty(rp);
            }
        }
        return jr;
    }
View Full Code Here

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

Examples of org.glassfish.resources.config.CustomResource

    /**
     * {@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

Examples of org.glassfish.resources.config.CustomResource

        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

Examples of org.glassfish.resources.config.CustomResource

    /**
     * {@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

Examples of org.glassfish.resources.config.CustomResource

     * {@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

Examples of org.glassfish.resources.config.CustomResource

            // 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

Examples of org.glassfish.resources.config.CustomResource

            // 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

Examples of org.glassfish.resources.config.CustomResource

        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

Examples of org.glassfish.resources.config.CustomResource

        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
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.