/** * A map of all values global to all running applications. * * <p>Note that this could be null if shared globals are not set up. * * @return The shared globals or null * @see #getComponent() */ public ConcurrentMap<String, Object> getSharedGlobals() { if (sharedGlobals == null) { Component component = getComponent(); if (component != null) sharedGlobals = component.getContext().getAttributes(); } return sharedGlobals; }
@Override public void startServer() throws Exception { component = new Component(); component.getServers().add(Protocol.HTTP, 8182); RestApplication application = module.newObject(RestApplication.class, component.getContext()); component.getDefaultHost().attach(application); component.start(); }
public void start(Properties configuration) throws Exception { if (!started) { component = new Component(); component .getServers() .add( Protocol.HTTP, Integer.valueOf(configuration.getProperty(MediaServerConfiguration.HTTP_PORT))); Context context = component.getContext().createChildContext(); component.getDefaultHost().attach(new MediaServerApplication(context)); component.start(); LOGGER.debug("Started test HTTP server"); started = true; } }
/** * Constructor. * * @param component The parent component. */ public ServerRouter(Component component) { super((component == null) ? null : component.getContext().createChildContext()); this.component = component; setRoutingMode(MODE_FIRST_MATCH); }