use of org.jboss.as.connector.subsystems.resourceadapters.ModifiableResourceAdapter in project wildfly by wildfly.
the class ResourceAdapterXmlDeploymentService method start.
/**
* Start
*/
@Override
public void start(StartContext context) throws StartException {
try {
Connector cmd = mdr.getValue().getResourceAdapter(deployment);
File root = mdr.getValue().getRoot(deployment);
Activation localRaXml = getRaxml();
cmd = (new Merger()).mergeConnectorWithCommonIronJacamar(localRaXml, cmd);
String id = ((ModifiableResourceAdapter) raxml).getId();
final ServiceName raServiceName;
if (id == null || id.trim().isEmpty()) {
raServiceName = ConnectorServices.getResourceAdapterServiceName(raName);
this.connectorServicesRegistrationName = raName;
} else {
raServiceName = ConnectorServices.getResourceAdapterServiceName(id);
this.connectorServicesRegistrationName = id;
}
final WildFlyRaXmlDeployer raDeployer = new WildFlyRaXmlDeployer(context.getChildTarget(), connectorXmlDescriptor.getUrl(), raName, root, module.getClassLoader(), cmd, localRaXml, deploymentServiceName);
raDeployer.setConfiguration(config.getValue());
WritableServiceBasedNamingStore.pushOwner(duServiceName);
ClassLoader old = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();
try {
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(module.getClassLoader());
raxmlDeployment = raDeployer.doDeploy();
} finally {
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(old);
WritableServiceBasedNamingStore.popOwner();
}
value = new ResourceAdapterDeployment(raxmlDeployment, raName, raServiceName);
managementRepository.getValue().getConnectors().add(value.getDeployment().getConnector());
registry.getValue().registerResourceAdapterDeployment(value);
context.getChildTarget().addService(raServiceName, new ResourceAdapterService(raServiceName, value.getDeployment().getResourceAdapter())).addDependency(deploymentServiceName).setInitialMode(ServiceController.Mode.ACTIVE).install();
} catch (Throwable t) {
cleanupStartAsync(context, raName, deploymentServiceName, t);
}
}
use of org.jboss.as.connector.subsystems.resourceadapters.ModifiableResourceAdapter in project wildfly by wildfly.
the class ConnectorServices method getDeploymentServiceName.
// resource-adapter DMR resource
public static synchronized ServiceName getDeploymentServiceName(final String raName, final Activation raxml) {
if (raName == null)
throw ConnectorLogger.ROOT_LOGGER.undefinedVar("RaName");
ServiceName serviceName = null;
ModifiableResourceAdapter ra = (ModifiableResourceAdapter) raxml;
if (ra != null && ra.getId() != null) {
serviceName = getDeploymentServiceName(raName, ra.getId());
} else {
serviceName = getDeploymentServiceName(raName, (String) null);
}
ROOT_LOGGER.tracef("ConnectorServices: getDeploymentServiceName(%s,%s) -> %s", raName, raxml, serviceName);
return serviceName;
}
Aggregations