本文整理汇总了Java中org.jboss.msc.value.ImmediateValue类的典型用法代码示例。如果您正苦于以下问题:Java ImmediateValue类的具体用法?Java ImmediateValue怎么用?Java ImmediateValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ImmediateValue类属于org.jboss.msc.value包,在下文中一共展示了ImmediateValue类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: startNeo4jDriverService
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
private void startNeo4jDriverService(OperationContext context, ConfigurationBuilder builder, final Set<String> outboundSocketBindings) throws OperationFailedException {
if (builder.getJNDIName() != null && builder.getJNDIName().length() > 0) {
final Neo4jClientConnectionService neo4jClientConnectionService = new Neo4jClientConnectionService(builder);
final ServiceName serviceName = ConnectionServiceAccess.serviceName(builder.getDescription());
final ContextNames.BindInfo bindingInfo = ContextNames.bindInfoFor(builder.getJNDIName());
final BinderService binderService = new BinderService(bindingInfo.getBindName());
context.getServiceTarget().addService(bindingInfo.getBinderServiceName(), binderService)
.addDependency(Neo4jSubsystemService.serviceName())
.addDependency(bindingInfo.getParentContextServiceName(), ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
.addDependency(serviceName, Neo4jClientConnectionService.class, new Injector<Neo4jClientConnectionService>() {
@Override
public void inject(final Neo4jClientConnectionService value) throws
InjectionException {
binderService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(new ImmediateValue<>(value.getDriver())));
}
@Override
public void uninject() {
binderService.getNamingStoreInjector().uninject();
}
}).install();
final ServiceBuilder<Neo4jClientConnectionService> serviceBuilder = context.getServiceTarget().addService(serviceName, neo4jClientConnectionService);
serviceBuilder.addDependency(Neo4jSubsystemService.serviceName(), new CastingInjector<>(neo4jClientConnectionService.getNeo4jSubsystemServiceInjectedValue(), Neo4jSubsystemService.class));
// add service dependency on each separate hostname/port reference in standalone*.xml referenced from this driver profile definition.
for (final String outboundSocketBinding : outboundSocketBindings) {
final ServiceName outboundSocketBindingDependency = context.getCapabilityServiceName(Neo4jDriverDefinition.OUTBOUND_SOCKET_BINDING_CAPABILITY_NAME, outboundSocketBinding, OutboundSocketBinding.class);
serviceBuilder.addDependency(ServiceBuilder.DependencyType.REQUIRED, outboundSocketBindingDependency, OutboundSocketBinding.class, neo4jClientConnectionService.getOutboundSocketBindingInjector(outboundSocketBinding));
}
if (builder.getSecurityDomain() != null) {
serviceBuilder.addDependency(SubjectFactoryService.SERVICE_NAME, SubjectFactory.class,
neo4jClientConnectionService.getSubjectFactoryInjector());
}
serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
}
}
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:39,代码来源:Neo4jDefinition.java
示例2: bindJndi
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
private <T> void bindJndi(OperationContext context, ServiceName serviceName, String jndiName, Class<T> clazz) {
ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(jndiName);
BinderService binderService = new BinderService(bindInfo.getBindName());
context.getServiceTarget().addService(bindInfo.getBinderServiceName(), binderService)
.addDependency(OrientSubsystemService.SERVICE_NAME)
.addDependency(bindInfo.getParentContextServiceName(), ServiceBasedNamingStore.class,
binderService.getNamingStoreInjector())
.addDependency(serviceName, OrientClientConnectionsService.class,
new Injector<OrientClientConnectionsService>() {
@Override
public void inject(final OrientClientConnectionsService value) throws InjectionException {
binderService.getManagedObjectInjector().inject(
new ValueManagedReferenceFactory(new ImmediateValue<>(value.unwrap(clazz))));
}
@Override
public void uninject() {
binderService.getNamingStoreInjector().uninject();
}
})
.install();
}
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:23,代码来源:OrientDefinition.java
示例3: activate
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
@Override
public void activate(ServiceActivatorContext context) throws ServiceRegistryException {
ServiceTarget target = context.getServiceTarget();
target.addService(TopologyManager.SERVICE_NAME, new ValueService<>(new ImmediateValue<>(TopologyManager.INSTANCE)))
.install();
BinderService binderService = new BinderService(Topology.JNDI_NAME, null, true);
target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, Topology.JNDI_NAME), binderService)
.addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
.addInjection(binderService.getManagedObjectInjector(), new ImmediateManagedReferenceFactory(TopologyManager.INSTANCE))
.setInitialMode(ServiceController.Mode.ACTIVE)
.install();
}
开发者ID:wildfly-swarm-archive,项目名称:wildfly-swarm-topology,代码行数:17,代码来源:TopologyManagerActivator.java
示例4: activate
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
@Override
public void activate(ServiceActivatorContext context) throws ServiceRegistryException {
ServiceTarget target = context.getServiceTarget();
TopologyManager.INSTANCE.setServiceTarget(target);
target.addService(SERVICE_NAME, new ValueService<>(new ImmediateValue<>(TopologyManager.INSTANCE)))
.install();
BinderService binderService = new BinderService(Topology.JNDI_NAME, null, true);
target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, Topology.JNDI_NAME), binderService)
.addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
.addInjection(binderService.getManagedObjectInjector(), new ImmediateManagedReferenceFactory(TopologyManager.INSTANCE))
.setInitialMode(ServiceController.Mode.ACTIVE)
.install();
}
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:19,代码来源:TopologyManagerActivator.java
示例5: installAliases
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
private void installAliases(final ModuleSpecification moduleSpecification, final ModuleIdentifier moduleIdentifier, final DeploymentUnit deploymentUnit, final DeploymentPhaseContext phaseContext) {
for (final ModuleIdentifier alias : moduleSpecification.getAliases()) {
final ServiceName moduleSpecServiceName = ServiceModuleLoader.moduleSpecServiceName(alias);
final ModuleSpec spec = ModuleSpec.buildAlias(alias, moduleIdentifier).create();
ModuleDefinition moduleDefinition = new ModuleDefinition(alias, new HashSet<>(moduleSpecification.getAllDependencies()), spec);
final ValueService<ModuleDefinition> moduleSpecService = new ValueService<>(new ImmediateValue<>(moduleDefinition));
phaseContext.getServiceTarget().addService(moduleSpecServiceName, moduleSpecService).addDependencies(
deploymentUnit.getServiceName()).addDependencies(phaseContext.getPhaseServiceName()).setInitialMode(
Mode.ON_DEMAND).install();
ModuleLoadService.installService(phaseContext.getServiceTarget(), alias, Collections.singletonList(moduleIdentifier));
ModuleResolvePhaseService.installService(phaseContext.getServiceTarget(), moduleDefinition);
}
}
开发者ID:wildfly,项目名称:wildfly-core,代码行数:18,代码来源:ModuleSpecProcessor.java
示例6: extend
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
@Override
public void extend(ApplicationExtensionContext context) throws Exception {
String appId = context.application().id();
ServiceTarget target = context.target();
URIPolicy policy = new URIPolicy();
target.addService(URIPolicyServices.policy(appId, context.resourceId()), new ValueService<>(new ImmediateValue<>(policy)))
.install();
URIPolicyRootResourceService resource = new URIPolicyRootResourceService(context.resourceId());
target.addService(Services.resource(appId, context.resourceId()), resource)
.addDependency(URIPolicyServices.policy(appId, context.resourceId()), URIPolicy.class, resource.policyInjector())
.install();
URIPolicyConfigResourceService configResource = new URIPolicyConfigResourceService(context.resourceId());
target.addService(Services.adminResource(appId, context.resourceId()), configResource)
.addDependency(URIPolicyServices.policy(appId, context.resourceId()), URIPolicy.class, configResource.policyInjector())
.install();
context.mountPublic();
context.mountPrivate();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:25,代码来源:URIPolicyExtension.java
示例7: extend
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
@Override
public void extend(SystemExtensionContext context) throws Exception {
// mount config resource so we can get access to extension configuration
MongoLauncherConfigResource configResource = new MongoLauncherConfigResource(context.id());
ValueService<RootResource> configService = new ValueService(new ImmediateValue(configResource));
context.target().addService(MONGO_LAUNCHER_CONFIG_NAME, configService).install();
context.mountPrivate(MONGO_LAUNCHER_CONFIG_NAME);
// start launcher service which uses extension configuration via configResource
// make sure to wait for configResource to get mounted in order to make sure
// it was updated with extension configuration
MongoLauncherService launcherService = new MongoLauncherService(context.id());
context.target().addService(MONGO_LAUNCHER_NAME, launcherService)
.addDependency(MONGO_LAUNCHER_CONFIG_NAME.append("mount"))
.addInjection(launcherService.configResourceInjector(), configResource)
.install();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:18,代码来源:MongoLauncherExtension.java
示例8: extend
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
@Override
public void extend(ApplicationExtensionContext context) throws Exception {
String appId = context.application().id();
ServiceTarget target = context.target();
DroolsPolicy policy = new DroolsPolicy();
target.addService(DroolsPolicyServices.policy(appId, context.resourceId()), new ValueService<>(new ImmediateValue<>(policy)))
.install();
DroolsPolicyResourceService resource = new DroolsPolicyResourceService(context.resourceId());
target.addService(Services.resource(appId, context.resourceId()), resource)
.addDependency(DroolsPolicyServices.policy(appId, context.resourceId()), DroolsPolicy.class, resource.policyInjector())
.install();
DroolsPolicyConfigResourceService configResource = new DroolsPolicyConfigResourceService(context.resourceId());
target.addService(Services.adminResource(appId, context.resourceId()), configResource)
.addDependency(DroolsPolicyServices.policy(appId, context.resourceId()), DroolsPolicy.class, configResource.policyInjector())
.install();
context.mountPublic();
context.mountPrivate();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:26,代码来源:DroolsPolicyExtension.java
示例9: extend
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
@Override
public void extend(SystemExtensionContext context) throws Exception {
ServiceName serviceName = Services.systemResource(context.moduleId(), context.id());
ApplicationTemplateResource applicationTemplateResource = new ApplicationTemplateResource(context.id());
ValueService applicationTemplateResourceService = new ValueService(new ImmediateValue<>(applicationTemplateResource));
context.target().addService(serviceName, applicationTemplateResourceService)
.install();
context.mountPrivate(serviceName);
TemplateRegistryService templateRegistryService = new TemplateRegistryService();
context.target().addService(SYSTEM_APPLICATION_TEMPLATE_REGISTRY, templateRegistryService)
.addDependency(serviceName, ApplicationTemplateResource.class, templateRegistryService.applicationTemplateResourceInjector())
.addDependency(serviceName.append("mount"))
.install();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:18,代码来源:TemplateExtension.java
示例10: start
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
@Override
public void start(StartContext context) throws StartException {
ServiceTarget target = context.getChildTarget();
target.addService(APPLICATIONS_DIR, new ApplicationsDirectoryService(new File(this.applicationsDirectoryInjector.getValue()).getAbsoluteFile()))
.install();
target.addService(APPLICATION_REGISTRY, new ApplicationRegistryService())
.install();
ApplicationsDeployerService deployerService = new ApplicationsDeployerService();
target.addService(APPLICATIONS_DEPLOYER, deployerService)
.addDependency(APPLICATIONS_DIR, File.class, deployerService.applicationsDirectoryInjector())
.addDependency(APPLICATION_REGISTRY, InternalApplicationRegistry.class, deployerService.applicationRegistryInjector())
.install();
Service<GlobalContext> globalContext = new ValueService<GlobalContext>(new ImmediateValue<>(new GlobalContext()));
target.addService(GLOBAL_CONTEXT, globalContext)
.install();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:21,代码来源:TenancyBootstrappingService.java
示例11: start
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
@Override
public void start(StartContext context) throws StartException {
ServiceTarget target = context.getChildTarget();
ExtensionLoader extensionLoader = new ExtensionLoader(new File(this.extensionsDirectoryInjector.getValue()).getAbsoluteFile());
target.addService(EXTENSION_LOADER, extensionLoader)
.addDependency(EXTENSION_INSTALLER, ExtensionInstaller.class, extensionLoader.extensionInstallerInjector())
.install();
ExtensionInstaller installer = new ExtensionInstaller(target);
target.addService(EXTENSION_INSTALLER, new ValueService<>(new ImmediateValue<>(installer)))
.install();
ZeroBootstrapper zero = new ZeroBootstrapper();
target.addService(Services.LIVEOAK.append("zero", "bootstrapper"), zero)
.addDependency(EXTENSION_INSTALLER, ExtensionInstaller.class, zero.extensionInstallerInjector())
.install();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:21,代码来源:ExtensionsBootstrappingService.java
示例12: start
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
@Override
public void start(StartContext context) throws StartException {
this.resource = new ApplicationResource(this.app, this.configManager.getValue(), this.applicationRegistry.getValue(), this.client.getValue());
ServiceTarget target = context.getChildTarget();
ServiceName name = context.getController().getName();
target.addService(name.append("extensions"), new ValueService<>(new ImmediateValue<>(this.resource.extensionsResource())))
.install();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:11,代码来源:ApplicationResourceService.java
示例13: setUpServiceContainer
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
@Before
public void setUpServiceContainer() throws Exception {
this.serviceContainer = ServiceContainer.Factory.create();
File appDir = new File(getClass().getClassLoader().getResource("apps").getFile());
this.serviceContainer.addService(Services.APPLICATIONS_DIR, new ApplicationsDirectoryService(appDir))
.install();
this.serviceContainer.addService(Services.SERVICE_REGISTRY, new ValueService<>(new ImmediateValue<>(this.serviceContainer))).install();
this.serviceContainer.addService(Services.CLIENT, new ClientService()).install();
this.serviceContainer.addService(Services.SECURITY_CLIENT, new ValueService<>(new ImmediateValue<>(new MockSecurityClient()))).install();
this.serviceContainer.addService(Services.SECURITY_DIRECT_ACCESS_CLIENT, new ValueService<>(new ImmediateValue<>(new MockDirectAccessClient()))).install();
this.serviceContainer.awaitStability();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:18,代码来源:TenancyTest.java
示例14: startCassandraDriverService
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
private void startCassandraDriverService(OperationContext context, ConfigurationBuilder builder, final Set<String> outboundSocketBindings) throws OperationFailedException {
if (builder.getJNDIName() != null && builder.getJNDIName().length() > 0) {
final CassandraClientConnectionsService cassandraClientConnectionsService = new CassandraClientConnectionsService(builder);
final ServiceName serviceName = ConnectionServiceAccess.serviceName(builder.getDescription());
final ContextNames.BindInfo bindingInfo = ContextNames.bindInfoFor(builder.getJNDIName());
final BinderService binderService = new BinderService(bindingInfo.getBindName());
context.getServiceTarget().addService(bindingInfo.getBinderServiceName(), binderService)
.addDependency(CassandraSubsystemService.serviceName())
.addDependency(bindingInfo.getParentContextServiceName(), ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
.addDependency(serviceName, CassandraClientConnectionsService.class, new Injector<CassandraClientConnectionsService>() {
@Override
public void inject(final CassandraClientConnectionsService value) throws
InjectionException {
binderService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(new ImmediateValue<>(value.getSession() != null ? value.getSession() : value.getCluster())));
}
@Override
public void uninject() {
binderService.getNamingStoreInjector().uninject();
}
}).install();
final ServiceBuilder<CassandraClientConnectionsService> serviceBuilder = context.getServiceTarget().addService(serviceName, cassandraClientConnectionsService);
serviceBuilder.addDependency(CassandraSubsystemService.serviceName(), new CastingInjector<>(cassandraClientConnectionsService.getCassandraSubsystemServiceInjectedValue(), CassandraSubsystemService.class));
// add service dependency on each separate hostname/port reference in standalone*.xml referenced from this driver profile definition.
for (final String outboundSocketBinding : outboundSocketBindings) {
final ServiceName outboundSocketBindingDependency = context.getCapabilityServiceName(CassandraDriverDefinition.OUTBOUND_SOCKET_BINDING_CAPABILITY_NAME, outboundSocketBinding, OutboundSocketBinding.class);
serviceBuilder.addDependency(ServiceBuilder.DependencyType.REQUIRED, outboundSocketBindingDependency, OutboundSocketBinding.class, cassandraClientConnectionsService.getOutboundSocketBindingInjector(outboundSocketBinding));
}
if (builder.getSecurityDomain() != null) {
serviceBuilder.addDependency(SubjectFactoryService.SERVICE_NAME, SubjectFactory.class,
cassandraClientConnectionsService.getSubjectFactoryInjector());
}
serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
}
}
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:40,代码来源:CassandraDefinition.java
示例15: startMongoDriverService
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
private void startMongoDriverService(OperationContext context, ConfigurationBuilder builder, Set<String> outboundSocketBindings) {
if (builder.getJNDIName() != null && builder.getJNDIName().length() > 0) {
final MongoClientConnectionsService mongoClientConnectionsService = new MongoClientConnectionsService(builder);
final ServiceName serviceName = ConnectionServiceAccess.serviceName(builder.getDescription());
final ContextNames.BindInfo bindingInfo = ContextNames.bindInfoFor(builder.getJNDIName());
final BinderService binderService = new BinderService(bindingInfo.getBindName());
context.getServiceTarget().addService(bindingInfo.getBinderServiceName(), binderService)
.addDependency(MongoSubsystemService.serviceName())
.addDependency(bindingInfo.getParentContextServiceName(), ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
.addDependency(serviceName, MongoClientConnectionsService.class, new Injector<MongoClientConnectionsService>() {
@Override
public void inject(final MongoClientConnectionsService value) throws
InjectionException {
binderService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(new ImmediateValue<>(value.getDatabase() != null ? value.getDatabase() : value.getClient())));
}
@Override
public void uninject() {
binderService.getNamingStoreInjector().uninject();
}
}).install();
final ServiceBuilder<MongoClientConnectionsService> serviceBuilder = context.getServiceTarget().addService(serviceName, mongoClientConnectionsService);
serviceBuilder.addDependency(MongoSubsystemService.serviceName(), new CastingInjector<>(mongoClientConnectionsService.getMongoSubsystemServiceInjectedValue(), MongoSubsystemService.class));
// add service dependency on each separate hostname/port reference in standalone*.xml referenced from this driver profile definition.
for (final String outboundSocketBinding : outboundSocketBindings) {
final ServiceName outboundSocketBindingDependency = context.getCapabilityServiceName(OUTBOUND_SOCKET_BINDING_CAPABILITY_NAME, outboundSocketBinding, OutboundSocketBinding.class);
serviceBuilder.addDependency(ServiceBuilder.DependencyType.REQUIRED, outboundSocketBindingDependency, OutboundSocketBinding.class, mongoClientConnectionsService.getOutboundSocketBindingInjector(outboundSocketBinding));
}
if (builder.getSecurityDomain() != null) {
serviceBuilder.addDependency(SubjectFactoryService.SERVICE_NAME, SubjectFactory.class,
mongoClientConnectionsService.getSubjectFactoryInjector());
}
serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
}
}
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:38,代码来源:MongoDefinition.java
示例16: start
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
public synchronized void start(StartContext startContext) throws StartException {
reference = new ValueManagedReference(new ImmediateValue<Object>(injector.getValue()));
}
开发者ID:kenweezy,项目名称:teiid,代码行数:4,代码来源:ReferenceFactoryService.java
示例17: test_7
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
static void test_7() throws NoSuchFieldException, SecurityException {
SimplePojo pojo = new SimplePojo();
pojo.description = "Hello World";
Field field = SimplePojo.class.getField("description");
FieldValue<Integer> value = new FieldValue<Integer>(field, new ImmediateValue<>(pojo));
System.out.println(value.getValue());
}
开发者ID:jbosschina,项目名称:wildfly-dev-cookbook,代码行数:8,代码来源:TestValue.java
示例18: test_3
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
static void test_3() throws NoSuchMethodException, SecurityException {
Value<SimplePojo> target = new ImmediateValue<>(new SimplePojo());
List<Value<String>> arguments =new ArrayList<>();
arguments.add(new ImmediateValue<String>("Hello World"));
final Injector<String> injector = new MethodInjector<String>(SimplePojo.class.getMethod("testMethod", String.class), target, Values.immediateValue("String"), arguments);
injector.inject(null);
}
开发者ID:jbosschina,项目名称:wildfly-dev-cookbook,代码行数:8,代码来源:TestInject.java
示例19: test_4
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
static void test_4() throws NoSuchMethodException, SecurityException {
Value<SimplePojo> target = new ImmediateValue<>(new SimplePojo());
Method method = SimplePojo.class.getMethod("setId", Integer.class);
final Injector<Integer> injector = SetMethodInjector.<Integer>create(target, method);
injector.inject(1000);
System.out.println(target.getValue().getId());
injector.uninject();
}
开发者ID:jbosschina,项目名称:wildfly-dev-cookbook,代码行数:9,代码来源:TestInject.java
示例20: getReference
import org.jboss.msc.value.ImmediateValue; //导入依赖的package包/类
@Override
public ManagedReference getReference() {
DefaultGelfSenderConfiguration senderConfiguration = new DefaultGelfSenderConfiguration();
senderConfiguration.setHost(configuration.getHost());
senderConfiguration.setPort(configuration.getPort());
final GelfSender gelfSender = GelfSenderFactory.createSender(senderConfiguration);
return new ValueManagedReference(new ImmediateValue<Object>(gelfSender)) {
@Override
public void release() {
gelfSender.close();
}
};
}
开发者ID:mp911de,项目名称:logstash-gelf-subsystem,代码行数:16,代码来源:GelfSenderManagedReferenceFactory.java
注:本文中的org.jboss.msc.value.ImmediateValue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论