本文整理匯總了Java中org.jboss.remoting3.RemotingOptions類的典型用法代碼示例。如果您正苦於以下問題:Java RemotingOptions類的具體用法?Java RemotingOptions怎麽用?Java RemotingOptions使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RemotingOptions類屬於org.jboss.remoting3包,在下文中一共展示了RemotingOptions類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getFullOptions
import org.jboss.remoting3.RemotingOptions; //導入依賴的package包/類
protected static OptionMap getFullOptions(OperationContext context, ModelNode fullModel) throws OperationFailedException {
OptionMap.Builder builder = OptionMap.builder();
builder.set(Options.TCP_NODELAY, true);
builder.set(Options.REUSE_ADDRESSES, true);
builder.set(RemotingOptions.SASL_PROTOCOL, ConnectorCommon.SASL_PROTOCOL.resolveModelAttribute(context, fullModel).asString());
ModelNode serverName = ConnectorCommon.SERVER_NAME.resolveModelAttribute(context, fullModel);
if (serverName.isDefined()) {
builder.set(RemotingOptions.SERVER_NAME, serverName.asString());
}
ModelNode properties = fullModel.get(PROPERTY);
if (properties.isDefined() && properties.asInt() > 0) {
addOptions(context, properties, builder);
}
if (fullModel.hasDefined(SECURITY)) {
ModelNode security = fullModel.require(SECURITY);
if (security.hasDefined(SASL)) {
ModelNode sasl = security.require(SASL);
addSasl(context, sasl, builder);
}
}
return builder.getMap();
}
示例2: getAuthenticationConfiguration
import org.jboss.remoting3.RemotingOptions; //導入依賴的package包/類
public AuthenticationConfiguration getAuthenticationConfiguration() {
AuthenticationConfiguration authenticationConfiguration = this.authenticationConfiguration.get();
final OptionMap optionMap = this.connectionCreationOptions;
if (optionMap != null) {
return RemotingOptions.mergeOptionsIntoAuthenticationConfiguration(optionMap, authenticationConfiguration);
}
return authenticationConfiguration;
}
示例3: performRuntime
import org.jboss.remoting3.RemotingOptions; //導入依賴的package包/類
@Override
public void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
final String saslAuthenticationFactory = asStringIfDefined(context, BaseNativeInterfaceResourceDefinition.SASL_AUTHENTICATION_FACTORY, model);
final String sslContext = asStringIfDefined(context, BaseNativeInterfaceResourceDefinition.SSL_CONTEXT, model);
final String securityRealm = asStringIfDefined(context, BaseNativeInterfaceResourceDefinition.SECURITY_REALM, model);
String serverName = asStringIfDefined(context, BaseNativeInterfaceResourceDefinition.SERVER_NAME, model);
Builder builder = OptionMap.builder();
builder.set(RemotingOptions.SASL_PROTOCOL, BaseNativeInterfaceResourceDefinition.SASL_PROTOCOL.resolveModelAttribute(context, model).asString());
if (serverName != null) {
builder.set(RemotingOptions.SERVER_NAME, serverName);
}
final OptionMap options = builder.getMap();
List<ServiceName> requiredServices = installServices(context, new NativeInterfaceCommonPolicy() {
@Override
public String getSaslAuthenticationFactory() {
return saslAuthenticationFactory;
}
@Override
public String getSSLContext() {
return sslContext;
}
@Override
public String getSecurityRealm() {
return securityRealm;
}
@Override
public OptionMap getConnectorOptions() {
return options;
}
}, model);
addVerifyInstallationStep(context, requiredServices);
}
示例4: start
import org.jboss.remoting3.RemotingOptions; //導入依賴的package包/類
/** {@inheritDoc} */
@Override
public synchronized void start(StartContext context) throws StartException {
final RemoteDomainConnection connection;
final ManagementChannelHandler handler;
try {
ScheduledExecutorService scheduledExecutorService = scheduledExecutorInjector.getValue();
this.responseAttachmentSupport = new ResponseAttachmentInputStreamSupport(scheduledExecutorService);
final OptionMap options = OptionMap.builder()
.set(RemotingOptions.HEARTBEAT_INTERVAL, 15000)
.set(Options.READ_TIMEOUT, 45000)
.getMap();
// Gather the required information to connect to the remote DC
// The URI will be set later when looping through discovery options when registering with
// or reconnecting to the remote DC.
final ProtocolConnectionConfiguration configuration = ProtocolConnectionConfiguration.create(endpointInjector.getValue(), options);
final AuthenticationContext authenticationContext = authenticationContextInjector.getOptionalValue();
final SecurityRealm realm = securityRealmInjector.getOptionalValue();
// Create the remote domain channel strategy
connection = new RemoteDomainConnection(localHostInfo.getLocalHostName(), configuration, authenticationContext, realm,
localHostInfo.getRemoteDomainControllerUsername(),
localHostInfo.getRemoteDomainControllerDiscoveryOptions(), executor, scheduledExecutorService,
new RemoteDomainConnection.HostRegistrationCallback() {
/**
* Calculates the metadata required when connecting to the master {@link org.jboss.as.domain.controller.DomainController}
* This value does not require locking during use, as {@link org.jboss.as.host.controller.mgmt.HostInfo createLocalHostHostInfo()} uses
* '/domain-controller', which is read-only, and '/core-service=ignored-resources/ignored-resource-type' which has handlers on
* add, remove and write-attribute that will place the host into reload-required.
* @return
*/
@Override
public ModelNode createLocalHostInfo() {
return HostInfo.createLocalHostHostInfo(localHostInfo, productConfig, ignoredDomainResourceRegistry, ReadRootResourceHandler.grabDomainResource(operationExecutor).getChildren(HOST).iterator().next());
}
@Override
public ModelNode resolveSubsystemVersions(ModelNode extensions) {
return resolveSubsystems(extensions.asList());
}
@Override
public boolean applyDomainModel(final List<ModelNode> bootOperations) {
// Apply the model..
final HostInfo info = HostInfo.fromModelNode(createLocalHostInfo());
return applyRemoteDomainModel(bootOperations, info);
}
@Override
public void registrationComplete(ManagementChannelHandler handler) {
RemoteDomainConnectionService.this.domainModelComplete.set(true);
}
}, runningMode);
// Setup the management channel handler
handler = connection.getChannelHandler();
handler.getAttachments().attach(ManagementChannelHandler.TEMP_DIR, tempDir);
} catch (Exception e) {
throw new StartException(e);
} finally {
futureClient.setClient(this);
}
this.connection = connection;
this.handler = handler;
}
示例5: performRuntime
import org.jboss.remoting3.RemotingOptions; //導入依賴的package包/類
@Override
public void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
final String httpAuthenticationFactory = asStringIfDefined(context, BaseHttpInterfaceResourceDefinition.HTTP_AUTHENTICATION_FACTORY, model);
final String sslContext = asStringIfDefined(context, BaseHttpInterfaceResourceDefinition.SSL_CONTEXT, model);
final String securityRealm = asStringIfDefined(context, BaseHttpInterfaceResourceDefinition.SECURITY_REALM, model);
final boolean consoleEnabled = BaseHttpInterfaceResourceDefinition.CONSOLE_ENABLED.resolveModelAttribute(context, model).asBoolean();
final boolean httpUpgradeEnabled;
final String saslAuthenticationFactory;
if (model.hasDefined(ModelDescriptionConstants.HTTP_UPGRADE)) {
ModelNode httpUpgrade = model.require(ModelDescriptionConstants.HTTP_UPGRADE);
httpUpgradeEnabled = BaseHttpInterfaceResourceDefinition.ENABLED.resolveModelAttribute(context, httpUpgrade).asBoolean();
saslAuthenticationFactory = asStringIfDefined(context, BaseHttpInterfaceResourceDefinition.SASL_AUTHENTICATION_FACTORY, httpUpgrade);
} else {
httpUpgradeEnabled = false;
saslAuthenticationFactory = null;
}
final List<String> allowedOrigins = BaseHttpInterfaceResourceDefinition.ALLOWED_ORIGINS.unwrap(context, model);
String serverName = asStringIfDefined(context, BaseHttpInterfaceResourceDefinition.SERVER_NAME, model);
Builder builder = OptionMap.builder();
builder.set(RemotingOptions.SASL_PROTOCOL, BaseHttpInterfaceResourceDefinition.SASL_PROTOCOL.resolveModelAttribute(context, model).asString());
if (serverName != null) {
builder.set(RemotingOptions.SERVER_NAME, serverName);
}
final OptionMap options = builder.getMap();
List<ServiceName> requiredServices = installServices(context, new HttpInterfaceCommonPolicy() {
@Override
public String getHttpAuthenticationFactory() {
return httpAuthenticationFactory;
}
@Override
public String getSSLContext() {
return sslContext;
}
@Override
public String getSaslAuthenticationFactory() {
return saslAuthenticationFactory;
}
@Override
public boolean isHttpUpgradeEnabled() {
return httpUpgradeEnabled;
}
@Override
public boolean isConsoleEnabled() {
return consoleEnabled;
}
@Override
public String getSecurityRealm() {
return securityRealm;
}
@Override
public OptionMap getConnectorOptions() {
return options;
}
@Override
public List<String> getAllowedOrigins() {
return allowedOrigins;
}
}, model);
addVerifyInstallationStep(context, requiredServices);
}