use of org.apache.openejb.loader.Options in project tomee by apache.
the class OutputGeneratedDescriptors method deploy.
public AppModule deploy(final AppModule appModule) throws OpenEJBException {
boolean output = SystemInstance.get().getOptions().get(OUTPUT_DESCRIPTORS, false);
if (output && appModule.getCmpMappings() != null) {
writeGenratedCmpMappings(appModule);
}
for (final EjbModule ejbModule : appModule.getEjbModules()) {
final Options options = new Options(ejbModule.getOpenejbJar().getProperties(), SystemInstance.get().getOptions());
final ValidationContext context = ejbModule.getValidation();
// output descriptors by default if there are validation errors
final boolean invalid = context.hasErrors() || context.hasFailures();
output = options.get(OUTPUT_DESCRIPTORS, invalid);
if (output) {
if (ejbModule.getEjbJar() != null) {
writeEjbJar(ejbModule);
}
if (ejbModule.getOpenejbJar() != null) {
writeOpenejbJar(ejbModule);
}
writeGeronimoOpenejb(ejbModule);
}
}
for (final ConnectorModule connectorModule : appModule.getConnectorModules()) {
writeRaXml(connectorModule);
}
return appModule;
}
use of org.apache.openejb.loader.Options in project tomee by apache.
the class ServiceDaemon method init.
@Override
public void init(final Properties props) throws Exception {
this.props = props;
final String formatString = props.getProperty("discovery");
if (formatString != null) {
this.discoveryUriFormat = new StringTemplate(formatString);
}
this.ip = PropertyPlaceHolderHelper.simpleValue(props.getProperty("bind"));
this.inetAddress = getAddress(this.ip);
final Options options = new Options(props);
this.port = Integer.parseInt(PropertyPlaceHolderHelper.simpleValue(options.get("port", "0")));
final int threads = options.get("threads", 100);
this.backlog = options.get("backlog", threads);
this.secure = options.get("secure", false);
this.timeout = options.get("timeout", this.timeout);
this.enabledCipherSuites = options.get("enabledCipherSuites", "SSL_DH_anon_WITH_RC4_128_MD5").split(",");
this.next.init(props);
}
use of org.apache.openejb.loader.Options in project tomee by apache.
the class FullRestartContainer method lookup.
private ExceptionManagerFacade lookup() {
final Options options = new Options(System.getProperties());
final Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, RemoteInitialContextFactory.class.getName());
final int port = ServerLocal.getPort(-1);
if (port > 0) {
System.out.println("provider url = " + "http://localhost:" + port + "/tomee/ejb");
props.put(Context.PROVIDER_URL, options.get(Context.PROVIDER_URL, "http://localhost:" + port + "/tomee/ejb"));
} else {
throw new OpenEJBTCKRuntimeException("Please set the tomee port using the system property 'server.http.port'");
}
try {
final InitialContext context = new InitialContext(props);
return (ExceptionManagerFacade) context.lookup("openejb/ExceptionManagerFacadeBusinessRemote");
} catch (final Exception e) {
throw new OpenEJBTCKRuntimeException(e);
}
}
use of org.apache.openejb.loader.Options in project tomee by apache.
the class OpenEJBHttpServer method init.
@Override
public void init(final Properties props) throws Exception {
final Options options = new Options(props);
options.setLogger(new OptionsLog(log));
print = options.getAll("print", OpenEJBHttpServer.Output.class);
indent = print.size() > 0 && options.get("" + "" + ".xml", false);
countStreams = options.get("stream.count", false);
}
use of org.apache.openejb.loader.Options in project tomee by apache.
the class DerbyNetworkService method init.
@Override
public void init(final Properties properties) throws Exception {
final Options options = new Options(properties);
this.port = options.get("port", 1527);
this.disabled = options.get("disabled", false);
this.verbose = options.get("verbose", false);
this.host = InetAddress.getByName("0.0.0.0");
System.setProperty("derby.system.home", options.get("derby.system.home", SystemInstance.get().getBase().getDirectory().getAbsolutePath()));
}
Aggregations