use of org.glassfish.resources.config.CustomResource in project Payara by payara.
the class CustomResourceDeployer method deployResource.
/**
* {@inheritDoc}
*/
@Override
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);
}
use of org.glassfish.resources.config.CustomResource in project Payara by payara.
the class CustomResourceDeployer method deployResource.
/**
* {@inheritDoc}
*/
@Override
public synchronized void deployResource(Object resource) throws Exception {
CustomResource customResource = (CustomResource) resource;
ResourceInfo resourceInfo = ResourceUtil.getResourceInfo(customResource);
deployResource(customResource, resourceInfo);
}
use of org.glassfish.resources.config.CustomResource in project Payara by payara.
the class CustomResourceDeployer method undeployResource.
/**
* {@inheritDoc}
*/
@Override
public synchronized void undeployResource(Object resource) throws Exception {
CustomResource customResource = (CustomResource) resource;
ResourceInfo resourceInfo = ResourceUtil.getResourceInfo(customResource);
deleteResource(customResource, resourceInfo);
}
use of org.glassfish.resources.config.CustomResource in project Payara by payara.
the class CustomResourceDeployer method deployResource.
private void deployResource(Object resource, ResourceInfo resourceInfo) {
CustomResource customRes = (CustomResource) resource;
// converts the config data to j2ee resource
JavaEEResource j2eeResource = toCustomJavaEEResource(customRes, resourceInfo);
// installs the resource
installCustomResource((org.glassfish.resources.beans.CustomResource) j2eeResource, resourceInfo);
}
use of org.glassfish.resources.config.CustomResource in project Payara by payara.
the class CustomResourceManager method createConfigBean.
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;
}
Aggregations