本文整理汇总了Java中org.wildfly.extension.gravia.GraviaConstants类的典型用法代码示例。如果您正苦于以下问题:Java GraviaConstants类的具体用法?Java GraviaConstants怎么用?Java GraviaConstants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GraviaConstants类属于org.wildfly.extension.gravia包,在下文中一共展示了GraviaConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deploy
import org.wildfly.extension.gravia.GraviaConstants; //导入依赖的package包/类
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
DeploymentUnit depUnit = phaseContext.getDeploymentUnit();
Resource resource = depUnit.getAttachment(GraviaConstants.RESOURCE_KEY);
if (resource != null)
return;
resource = NamedResourceAssociation.getResource(depUnit.getName());
if (resource == null) {
ResourceRoot deploymentRoot = depUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
Manifest manifest = deploymentRoot != null ? deploymentRoot.getAttachment(Attachments.MANIFEST) : null;
if (manifest != null) {
ManifestResourceBuilder builder = new ManifestResourceBuilder().load(manifest);
if (builder.isValid()) {
resource = builder.getResource();
}
}
}
if (resource != null) {
depUnit.putAttachment(GraviaConstants.RESOURCE_KEY, resource);
}
}
示例2: install
import org.wildfly.extension.gravia.GraviaConstants; //导入依赖的package包/类
public ServiceController<Void> install(ServiceTarget serviceTarget, ServiceVerificationHandler verificationHandler) {
ServiceBuilder<Void> builder = serviceTarget.addService(FabricConstants.FABRIC_SUBSYSTEM_SERVICE_NAME, this);
builder.addDependency(GraviaConstants.MODULE_CONTEXT_SERVICE_NAME, ModuleContext.class, injectedModuleContext);
builder.addDependency(GraviaConstants.RUNTIME_SERVICE_NAME, Runtime.class, injectedRuntime);
builder.addListener(verificationHandler);
return builder.install();
}
示例3: addService
import org.wildfly.extension.gravia.GraviaConstants; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public static ServiceController<UndertowHost> addService(ServiceTarget serviceTarget, RuntimeState runtimeState) {
CamelUndertowHostService service = new CamelUndertowHostService(runtimeState);
ServiceBuilder<UndertowHost> builder = serviceTarget.addService(SERVICE_NAME, service);
builder.addDependency(GraviaConstants.RUNTIME_SERVICE_NAME, Runtime.class, service.injectedRuntime);
builder.addDependency(UndertowService.UNDERTOW, UndertowService.class, service.injectedUndertowService);
builder.addDependency(SocketBinding.JBOSS_BINDING_NAME.append("http"), SocketBinding.class, service.injectedHttpSocketBinding);
builder.addDependency(UndertowService.virtualHostName("default-server", "default-host"), Host.class, service.injectedDefaultHost);
return builder.install();
}
示例4: addService
import org.wildfly.extension.gravia.GraviaConstants; //导入依赖的package包/类
public static ServiceController<Host> addService(ServiceTarget serviceTarget) {
UndertowHostService service = new UndertowHostService();
ServiceBuilder<Host> builder = serviceTarget.addService(SERVICE_NAME, service);
builder.addDependency(GraviaConstants.RUNTIME_SERVICE_NAME, Runtime.class, service.injectedRuntime);
builder.addDependency(UndertowService.virtualHostName("default-server", "default-host"), Host.class, service.injectedDefaultHost);
return builder.install();
}
示例5: deploy
import org.wildfly.extension.gravia.GraviaConstants; //导入依赖的package包/类
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
DeploymentUnit depUnit = phaseContext.getDeploymentUnit();
CamelDeploymentSettings depSettings = depUnit.getAttachment(CamelDeploymentSettings.ATTACHMENT_KEY);
// No camel dependencies if camel is disabled
if (!depSettings.isEnabled()) {
return;
}
phaseContext.addDeploymentDependency(CamelConstants.CONTEXT_CREATE_HANDLER_REGISTRY_SERVICE_NAME, CamelConstants.CONTEXT_CREATE_HANDLER_REGISTRY_KEY);
phaseContext.addDeploymentDependency(CamelConstants.CAMEL_CONTEXT_REGISTRY_SERVICE_NAME, CamelConstants.CAMEL_CONTEXT_REGISTRY_KEY);
phaseContext.addDeploymentDependency(CamelConstants.CAMEL_CONTEXT_FACTORY_SERVICE_NAME, CamelConstants.CAMEL_CONTEXT_FACTORY_KEY);
phaseContext.addDeploymentDependency(GraviaConstants.RUNTIME_SERVICE_NAME, GraviaConstants.RUNTIME_KEY);
}
示例6: addService
import org.wildfly.extension.gravia.GraviaConstants; //导入依赖的package包/类
public static ServiceController<MutableCamelContextRegistry> addService(ServiceTarget serviceTarget, SubsystemState subsystemState) {
CamelContextRegistryService service = new CamelContextRegistryService(subsystemState);
ServiceBuilder<MutableCamelContextRegistry> builder = serviceTarget.addService(CamelConstants.CAMEL_CONTEXT_REGISTRY_SERVICE_NAME, service);
builder.addDependency(GraviaConstants.RUNTIME_SERVICE_NAME, Runtime.class, service.injectedRuntime);
builder.addDependency(CamelConstants.CONTEXT_CREATE_HANDLER_REGISTRY_SERVICE_NAME, ContextCreateHandlerRegistry.class, service.injectedHandlerRegistry);
return builder.install();
}
示例7: deploy
import org.wildfly.extension.gravia.GraviaConstants; //导入依赖的package包/类
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
DeploymentUnit depUnit = phaseContext.getDeploymentUnit();
Resource resource = depUnit.getAttachment(GraviaConstants.RESOURCE_KEY);
if (resource != null) {
phaseContext.addDeploymentDependency(GraviaConstants.RUNTIME_SERVICE_NAME, GraviaConstants.RUNTIME_KEY);
}
}
示例8: deploy
import org.wildfly.extension.gravia.GraviaConstants; //导入依赖的package包/类
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
DeploymentUnit depUnit = phaseContext.getDeploymentUnit();
Module module = depUnit.getAttachment(GraviaConstants.MODULE_KEY);
if (module != null) {
try {
module.start();
} catch (ModuleException ex) {
throw new DeploymentUnitProcessingException(ex);
}
}
}
示例9: undeploy
import org.wildfly.extension.gravia.GraviaConstants; //导入依赖的package包/类
@Override
public void undeploy(final DeploymentUnit depUnit) {
Module module = depUnit.getAttachment(GraviaConstants.MODULE_KEY);
if (module != null && module.getState() != Module.State.UNINSTALLED) {
try {
module.stop();
} catch (ModuleException ex) {
LOGGER.error("Cannot stop module: " + module, ex);
}
}
}
示例10: deploy
import org.wildfly.extension.gravia.GraviaConstants; //导入依赖的package包/类
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
DeploymentUnit depUnit = phaseContext.getDeploymentUnit();
if (depUnit.hasAttachment(GraviaConstants.RESOURCE_KEY)) {
ModuleSpecification moduleSpecification = depUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
moduleSpecification.addSystemDependencies(systemDependencies);
}
}
示例11: deploy
import org.wildfly.extension.gravia.GraviaConstants; //导入依赖的package包/类
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
DeploymentUnit depUnit = phaseContext.getDeploymentUnit();
Resource resource = depUnit.getAttachment(GraviaConstants.RESOURCE_KEY);
if (resource == null)
return;
// Get the headers from the manifest
Dictionary<String, String> headers = null;
ResourceRoot deploymentRoot = depUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
Manifest manifest = deploymentRoot != null ? deploymentRoot.getAttachment(Attachments.MANIFEST) : null;
if (manifest != null) {
headers = new ManifestHeadersProvider(manifest).getHeaders();
}
// Initialize the module install context
AttachableSupport context = new AttachableSupport();
context.putAttachment(WildFlyRuntime.DEPLOYMENT_ROOT_KEY, deploymentRoot);
// Install the module
ModuleClassLoader classLoader = depUnit.getAttachment(Attachments.MODULE).getClassLoader();
try {
Runtime runtime = RuntimeLocator.getRequiredRuntime();
Module module = runtime.installModule(classLoader, resource, headers, context);
depUnit.putAttachment(GraviaConstants.MODULE_KEY, module);
depUnit.putAttachment(GraviaConstants.RESOURCE_KEY, module.adapt(Resource.class));
} catch (ModuleException ex) {
throw new DeploymentUnitProcessingException(ex);
}
}
示例12: undeploy
import org.wildfly.extension.gravia.GraviaConstants; //导入依赖的package包/类
@Override
public void undeploy(final DeploymentUnit depUnit) {
Module module = depUnit.getAttachment(GraviaConstants.MODULE_KEY);
if (module != null && module.getState() != Module.State.UNINSTALLED) {
module.uninstall();
}
}
示例13: addService
import org.wildfly.extension.gravia.GraviaConstants; //导入依赖的package包/类
public static ServiceController<CamelContextFactory> addService(ServiceTarget serviceTarget) {
CamelContextFactoryService service = new CamelContextFactoryService();
ServiceBuilder<CamelContextFactory> builder = serviceTarget.addService(CamelConstants.CAMEL_CONTEXT_FACTORY_SERVICE_NAME, service);
builder.addDependency(GraviaConstants.RUNTIME_SERVICE_NAME, Runtime.class, service.injectedRuntime);
return builder.install();
}
示例14: addService
import org.wildfly.extension.gravia.GraviaConstants; //导入依赖的package包/类
public static ServiceController<Void> addService(ServiceTarget serviceTarget) {
CamelBootstrapService service = new CamelBootstrapService();
ServiceBuilder<Void> builder = serviceTarget.addService(CamelConstants.CAMEL_SUBSYSTEM_SERVICE_NAME, service);
builder.addDependency(GraviaConstants.RUNTIME_SERVICE_NAME, Runtime.class, service.injectedRuntime);
return builder.install();
}
示例15: addService
import org.wildfly.extension.gravia.GraviaConstants; //导入依赖的package包/类
public static ServiceController<ContextCreateHandlerRegistry> addService(ServiceTarget serviceTarget, SubsystemState subsystemState) {
ContextCreateHandlerRegistryService service = new ContextCreateHandlerRegistryService(subsystemState);
ServiceBuilder<ContextCreateHandlerRegistry> builder = serviceTarget.addService(CamelConstants.CONTEXT_CREATE_HANDLER_REGISTRY_SERVICE_NAME, service);
builder.addDependency(GraviaConstants.RUNTIME_SERVICE_NAME, Runtime.class, service.injectedRuntime);
return builder.install();
}