Examples of ExternalJndiResource


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

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

        ExternalJndiResource jr = new com.sun.enterprise.resource.beans.ExternalJndiResource(resourceInfo);

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

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

        // sets the jndi look up name
        jr.setJndiLookupName( rbean.getJndiLookupName() );

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

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

Examples of org.glassfish.resources.config.ExternalJndiResource

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

        ExternalJndiResource jndiRes =
                (ExternalJndiResource) resource;
        ResourceInfo resourceInfo = ResourceUtil.getResourceInfo(jndiRes);
        createExternalJndiResource(jndiRes, resourceInfo);
    }
View Full Code Here

Examples of org.glassfish.resources.config.ExternalJndiResource

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

Examples of org.glassfish.resources.config.ExternalJndiResource

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

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

Examples of org.glassfish.resources.config.ExternalJndiResource

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

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

Examples of org.glassfish.resources.config.ExternalJndiResource

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

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

Examples of org.glassfish.resources.config.ExternalJndiResource

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

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

Examples of org.glassfish.resources.config.ExternalJndiResource

        return newResource;
    }

    private ExternalJndiResource createConfigBean(Resources param, Properties properties) throws PropertyVetoException,
            TransactionFailure {
        ExternalJndiResource newResource = param.createChild(ExternalJndiResource.class);
        newResource.setJndiName(jndiName);
        newResource.setFactoryClass(factoryClass);
        newResource.setJndiLookupName(jndiLookupName);
        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.