public DeploymentContext(final String id, final Options parent) { this.id = id; this.options = new Options(properties, parent); }
public ServicePool(final ServerService next, final Properties properties) { /**Defaults. * This suggests that 10 core threads should cope with up to 19 runnables (threads + queue, whereby queue = threads - 1). * Any more than 19 runnables will spawn a thread to cope if the thread count is less than 150. * If 150 threads are processing runnables and the queue is full then block and wait for * a slot for up to 10 seconds before rejecting the runnable. * If a thread remains idle for more than 1 minute then it will be removed. */ this(next, new Options(properties)); } public ServicePool(final ServerService next, final Options properties) {
public DeploymentContext(final String id, final Options parent) { this.id = id; this.options = new Options(properties, parent); }
public ServicePool(ServerService next, String name, Properties properties) { this(next, name, new Options(properties).get("threads", 100)); }
private Deployer lookup() { final Options options = new Options(System.getProperties()); final Properties props = new Properties(); props.put(Context.INITIAL_CONTEXT_FACTORY, RemoteInitialContextFactory.class.getName()); props.put(Context.PROVIDER_URL, options.get(Context.PROVIDER_URL, "http://localhost:" + port + "/tomee/ejb")); final String deployerJndi = System.getProperty("openejb.deployer.jndiname", "openejb/DeployerBusinessRemote"); try { final InitialContext context = new InitialContext(props); return (Deployer) context.lookup(deployerJndi); } catch (final Exception e) { throw new OpenEJBTCKRuntimeException(e); } }
private Deployer lookup() { final Options options = new Options(System.getProperties()); final Properties props = new Properties(); props.put(Context.INITIAL_CONTEXT_FACTORY, RemoteInitialContextFactory.class.getName()); props.put(Context.PROVIDER_URL, options.get(Context.PROVIDER_URL, "http://localhost:" + port + "/tomee/ejb")); final String deployerJndi = System.getProperty("openejb.deployer.jndiname", "openejb/DeployerBusinessRemote"); try { final InitialContext context = new InitialContext(props); return (Deployer) context.lookup(deployerJndi); } catch (final Exception e) { throw new OpenEJBTCKRuntimeException(e); } }
private SystemInstance(Properties properties) throws Exception { this.components = new HashMap<Class, Object>(); this.internalProperties.putAll(System.getProperties()); this.internalProperties.putAll(properties); this.options = new Options(internalProperties, new Options(System.getProperties())); this.home = new FileUtils("openejb.home", "user.dir", this.internalProperties); this.base = new FileUtils("openejb.base", "openejb.home", this.internalProperties); this.classPath = ClassPathFactory.createClassPath(this.internalProperties.getProperty("openejb.loader", "context")); this.classLoader = classPath.getClassLoader(); this.internalProperties.setProperty("openejb.home", home.getDirectory().getCanonicalPath()); this.internalProperties.setProperty("openejb.base", base.getDirectory().getCanonicalPath()); System.setProperty("derby.system.home", base.getDirectory().getCanonicalPath()); // set the magic system property that causes derby to use explicity // file sync instead of relying on vm support for file open rws System.setProperty("derby.storage.fileSyncTransactionLog", "true"); }
@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("indent.xml", false); debugPayload = "true".equalsIgnoreCase(props.getProperty("debugPayload", "true")); }
@SuppressWarnings("UseOfObsoleteCollectionType") public LocalInitialContext(final Hashtable env, final LocalInitialContextFactory factory) throws NamingException { super(getContainerSystemEjbContext()); properties = new Properties(); properties.putAll(env); options = new Options(properties); onClose = options.get(ON_CLOSE, Close.LOGOUT); this.factory = factory; login(); startNetworkServices(); }
@SuppressWarnings("UseOfObsoleteCollectionType") public LocalInitialContext(final Hashtable env, final LocalInitialContextFactory factory) throws NamingException { super(getContainerSystemEjbContext()); properties = new Properties(); properties.putAll(env); options = new Options(properties); onClose = options.get(ON_CLOSE, Close.LOGOUT); this.factory = factory; login(); startNetworkServices(); }
public LocalInitialContext(Hashtable env, LocalInitialContextFactory factory) throws NamingException { super(getContainerSystemEjbContext()); properties = new Properties(); properties.putAll(env); options = new Options(properties); onClose = options.get(ON_CLOSE, Close.LOGOUT); this.factory = factory; login(); startNetworkServices(); }
public void init(Properties props) throws OpenEJBException { this.props = new Properties(props); Options options = new Options(props, SystemInstance.get().getOptions()); String className = options.get("openejb.configurator", "org.apache.openejb.config.ConfigurationFactory"); configFactory = (OpenEjbConfigurationFactory) toolkit.newInstance(className); configFactory.init(props); }
@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); }
public void init(Properties props) throws Exception { String formatString = props.getProperty("discovery"); if (formatString != null){ discoveryUriFormat = new StringTemplate(formatString); } ip = props.getProperty("bind"); address = getAddress(ip); Options options = new Options(props); port = options.get("port", 0); int threads = options.get("threads", 100); backlog = options.get("backlog", threads); secure = options.get("secure", false); timeout = 1000; next.init(props); }
@Override public void init(final Properties props) throws OpenEJBException { this.props = new Properties(props); final Options options = new Options(props, SystemInstance.get().getOptions()); final String className = options.get("openejb.configurator", "org.apache.openejb.config.ConfigurationFactory"); if ("org.apache.openejb.config.ConfigurationFactory".equals(className)) { configFactory = new ConfigurationFactory(); // no need to use reflection } else { configFactory = (OpenEjbConfigurationFactory) toolkit.newInstance(className); } configFactory.init(props); SystemInstance.get().setComponent(OpenEjbConfigurationFactory.class, configFactory); }
@Override public void init(final Properties props) throws OpenEJBException { this.props = new Properties(props); final Options options = new Options(props, SystemInstance.get().getOptions()); final String className = options.get("openejb.configurator", "org.apache.openejb.config.ConfigurationFactory"); if ("org.apache.openejb.config.ConfigurationFactory".equals(className)) { configFactory = new ConfigurationFactory(); // no need to use reflection } else { configFactory = (OpenEjbConfigurationFactory) toolkit.newInstance(className); } configFactory.init(props); SystemInstance.get().setComponent(OpenEjbConfigurationFactory.class, configFactory); }
@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); }
private OpenEjbContainer(final Map<?, ?> map, final AppContext appContext) { webBeanContext = appContext.getWebBeansContext(); globalJndiContext = new GlobalContext(appContext.getGlobalJndiContext()); final Properties properties = new Properties(); properties.putAll(map); options = new Options(properties); startNetworkServices(); servletContext = new MockServletContext(); session = new MockHttpSession(); try { startContexts(webBeanContext.getContextsService(), servletContext, session); } catch (final Exception e) { logger().warning("can't start all CDI contexts", e); } }
private OpenEjbContainer(final Map<?, ?> map, final AppContext appContext) { webBeanContext = appContext.getWebBeansContext(); globalJndiContext = new GlobalContext(appContext.getGlobalJndiContext()); final Properties properties = new Properties(); properties.putAll(map); options = new Options(properties); startNetworkServices(); if (webBeanContext != null) { servletContext = new MockServletContext(); session = new MockHttpSession(); try { startContexts(webBeanContext.getContextsService(), servletContext, session); } catch (final Exception e) { logger().warning("can't start all CDI contexts", e); } } }
@Override public void init(final Properties props) { final Options options = new Options(props); options.setLogger(new OptionsLog(log)); host = props.getProperty("bind", host); loopbackMode = options.get("loopback_mode", loopbackMode); port = options.get("port", port); heartRate = options.get("heart_rate", heartRate); final Tracker.Builder builder = new Tracker.Builder(); builder.setGroup(props.getProperty("group", builder.getGroup())); builder.setHeartRate(heartRate); builder.setMaxMissedHeartbeats(options.get("max_missed_heartbeats", builder.getMaxMissedHeartbeats())); builder.setMaxReconnectDelay(options.get("max_reconnect_delay", builder.getMaxReconnectDelay())); builder.setReconnectDelay(options.get("reconnect_delay", builder.getReconnectDelay())); builder.setExponentialBackoff(options.get("exponential_backoff", builder.getExponentialBackoff())); builder.setMaxReconnectAttempts(options.get("max_reconnect_attempts", builder.getMaxReconnectAttempts())); tracker = builder.build(); }