Search in sources :

Example 16 with Options

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;
}
Also used : Options(org.apache.openejb.loader.Options)

Example 17 with Options

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);
}
Also used : Options(org.apache.openejb.loader.Options) StringTemplate(org.apache.openejb.util.StringTemplate)

Example 18 with Options

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);
    }
}
Also used : Options(org.apache.openejb.loader.Options) ExceptionManagerFacade(org.apache.tomee.catalina.facade.ExceptionManagerFacade) RemoteInitialContextFactory(org.apache.openejb.client.RemoteInitialContextFactory) OpenEJBTCKRuntimeException(org.apache.openejb.tck.OpenEJBTCKRuntimeException) Properties(java.util.Properties) InitialContext(javax.naming.InitialContext) OpenEJBTCKRuntimeException(org.apache.openejb.tck.OpenEJBTCKRuntimeException) IOException(java.io.IOException) DeploymentException(org.jboss.testharness.api.DeploymentException)

Example 19 with Options

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);
}
Also used : Options(org.apache.openejb.loader.Options) OptionsLog(org.apache.openejb.util.OptionsLog)

Example 20 with Options

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()));
}
Also used : Options(org.apache.openejb.loader.Options)

Aggregations

Options (org.apache.openejb.loader.Options)21 IOException (java.io.IOException)7 OpenEJBException (org.apache.openejb.OpenEJBException)5 Properties (java.util.Properties)4 NamingException (javax.naming.NamingException)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)3 ArrayList (java.util.ArrayList)3 TimeoutException (java.util.concurrent.TimeoutException)3 MBeanServer (javax.management.MBeanServer)3 MalformedObjectNameException (javax.management.MalformedObjectNameException)3 ObjectName (javax.management.ObjectName)3 ApplicationException (org.apache.openejb.ApplicationException)3 SystemException (org.apache.openejb.SystemException)3 OptionsLog (org.apache.openejb.util.OptionsLog)3 URL (java.net.URL)2 RemoteException (java.rmi.RemoteException)2 HashSet (java.util.HashSet)2 LinkedHashSet (java.util.LinkedHashSet)2 AttributeNotFoundException (javax.management.AttributeNotFoundException)2 InstanceNotFoundException (javax.management.InstanceNotFoundException)2