@Override public void wire(ManagedObjectSourceWirerContext context) { context.setManagedObjectScope(ManagedObjectScope.PROCESS); } };
/** * Destroys this {@link ServletWebAutoWireApplication}. */ public void destroy() { synchronized (ServletWebAutoWireApplication.class) { // Ensure close OfficeFloor if (this.officeFloor != null) { // Close OfficeFloor this.officeFloor.closeOfficeFloor(); // Release reference this.officeFloor = null; } } }
@Override public void wire(ManagedObjectSourceWirerContext context) { context.setManagedObjectScope(ManagedObjectScope.PROCESS); context.mapTeam( CometServiceManagedObjectSource.EXPIRE_TEAM_NAME, OnePersonTeamSource.class.getName()); } }, new AutoWire(CometService.class)).setTimeout(600 * 1000);
/** * Convenience method to auto-wire in a * {@link HttpServerSocketManagedObjectSource} into an * {@link AutoWireApplication}. * * @param source * {@link AutoWireApplication}. * @param port * Port to listen for HTTP requests. * @param sectionName * Name of the {@link SectionNode}. * @param sectionInputName * Name of the {@link SectionInput}. * @return {@link AutoWireObject}. */ public static AutoWireObject autoWire(AutoWireApplication source, int port, String sectionName, String sectionInputName) { // Create the wirer ManagedObjectSourceWirer wirer = createManagedObjectSourceWirer( sectionName, sectionInputName); // Add this managed object source AutoWireObject object = source.addManagedObject( HttpServerSocketManagedObjectSource.class.getName(), wirer, new AutoWire(ServerHttpConnection.class)); object.addProperty(PROPERTY_PORT, String.valueOf(port)); // Return the object return object; }
@Override public AutoWireObject addHttpApplicationObject(Class<?> objectClass, String bindName) { // Determine if already registered the type AutoWireObject object = this.httpApplicationObjects.get(objectClass); if (object != null) { return object; // return the already registered object } // Not registered, so register object = this.addManagedObject(HttpApplicationObjectManagedObjectSource.class.getName(), processScopeWirer, new AutoWire(objectClass)); object.addProperty(HttpApplicationObjectManagedObjectSource.PROPERTY_CLASS_NAME, objectClass.getName()); if ((bindName != null) && (bindName.trim().length() > 0)) { object.addProperty(HttpApplicationObjectManagedObjectSource.PROPERTY_BIND_NAME, bindName); } this.httpApplicationObjects.put(objectClass, object); // Return the object return object; }
new AutoWire(objectClass)); object.addProperty(HttpRequestObjectManagedObjectSource.PROPERTY_CLASS_NAME, objectClass.getName()); if ((bindName != null) && (bindName.trim().length() > 0)) { object.addProperty(HttpRequestObjectManagedObjectSource.PROPERTY_BIND_NAME, bindName); for (Property property : object.getProperties()) { if (HttpRequestObjectManagedObjectSource.PROPERTY_IS_LOAD_HTTP_PARAMETERS.equals(property.getName())) { loadParametersProperty = property; object.addProperty(HttpRequestObjectManagedObjectSource.PROPERTY_IS_LOAD_HTTP_PARAMETERS, String.valueOf(true)); } else {
@Override public void wire(ManagedObjectSourceWirerContext context) { // Process scoped context.setManagedObjectScope(ManagedObjectScope.PROCESS); // Map flow to service context.mapFlow(FlowKeys.SERVICE.name(), handlerSectionName, handlerInputName); // Configure team for recycle task if (isUseAsync) { context.mapTeam("COMPLETE", PassiveTeamSource.class.getName()); } } }, new AutoWire(ServletBridge.class));
new AutoWire(HttpSession.class)); this.httpSession.setTimeout(10 * 1000); new AutoWire(HttpApplicationState.class)); this.addManagedObject(HttpRequestStateManagedObjectSource.class.getName(), processScopeWirer, new AutoWire(HttpRequestState.class));
@Override public void wire(ManagedObjectSourceWirerContext context) { context.setManagedObjectScope(ManagedObjectScope.PROCESS); context.mapFlow("AUTHENTICATE", WebApplicationAutoWireOfficeFloorSource.this.security.getSectionName(), "ManagedObjectAuthenticate"); context.mapFlow("LOGOUT", WebApplicationAutoWireOfficeFloorSource.this.security.getSectionName(), "ManagedObjectLogout"); } }, new AutoWire(HttpAuthentication.class));
@Override public void wire(ManagedObjectSourceWirerContext context) { // Provide thread per each accepter and listener context.mapTeam("accepter", WorkerPerTaskTeamSource.class.getName()); context.mapTeam("listener", WorkerPerTaskTeamSource.class.getName()); // Clean up (without thread context switch) context.mapTeam("cleanup", PassiveTeamSource.class.getName()); // Map request handler context.mapFlow("HANDLE_HTTP_REQUEST", sectionName, sectionInputName); } };
@Override public AutoWireSection transformAutoWireSection( AutoWireSectionTransformerContext context) { // Obtain the transformed auto-wire section AutoWireSection section = super.transformAutoWireSection(context); // Obtain the name of section being transformed String sectionName = section.getSectionName(); // Add properties for URL continuations of the section for (UriLink link : this.uriLinks) { // Ignore if link not for section if (!(sectionName.equals(link.section.getSectionName()))) { continue; // link not for section } // Add properties for the link section.addProperty(PROPERTY_URL_LINK_PREFIX + link.applicationUriPath, link.inputName); section.addProperty(PROPERTY_URL_SECURE_PREFIX + link.applicationUriPath, String.valueOf(link.isSecure)); } // Return the transformed auto-wire section return section; }
AutoWireObject object = source.addManagedObject( HttpsServerSocketManagedObjectSource.class.getName(), wirer, new AutoWire(ServerHttpConnection.class)); object.addProperty(PROPERTY_PORT, String.valueOf(port)); if (sslEngineSourceClass != null) { object.addProperty( SslCommunicationProtocol.PROPERTY_SSL_ENGINE_SOURCE, sslEngineSourceClass.getName());
@Override public AutoWireObject addHttpSessionObject(Class<?> objectClass, String bindName) { // Determine if already registered the type AutoWireObject object = this.httpSessionObjects.get(objectClass); if (object != null) { return object; // return the already registered object } // Not registered, so register object = this.addManagedObject(HttpSessionObjectManagedObjectSource.class.getName(), processScopeWirer, new AutoWire(objectClass)); object.addProperty(HttpSessionObjectManagedObjectSource.PROPERTY_CLASS_NAME, objectClass.getName()); if ((bindName != null) && (bindName.trim().length() > 0)) { object.addProperty(HttpSessionObjectManagedObjectSource.PROPERTY_BIND_NAME, bindName); } this.httpSessionObjects.put(objectClass, object); // Return the object return object; }
@Override public void wire(ManagedObjectSourceWirerContext context) { context.setManagedObjectScope(ManagedObjectScope.PROCESS); } };
@Override public void wire(ManagedObjectSourceWirerContext context) { // Provide thread per each accepter and listener context.mapTeam("accepter", WorkerPerTaskTeamSource.class.getName()); context.mapTeam("listener", WorkerPerTaskTeamSource.class.getName()); // Clean up (without thread context switch) context.mapTeam("cleanup", PassiveTeamSource.class.getName()); // Service SSL tasks within own thread context.mapTeam("SSL_TASKS", OnePersonTeamSource.class.getName()); // Map request handler context.mapFlow("HANDLE_HTTP_REQUEST", sectionName, sectionInputName); } };
@Override public void stop() throws UnableToCompleteException { // Close OfficeFloor if running (stopping container) if (this.officeFloor != null) { // Stop container this.officeFloor.closeOfficeFloor(); this.officeFloor = null; // clear reference // Log container stopped if (this.logger.isLoggable(Type.INFO)) { this.logger.log(Type.INFO, this.containerName + " stopped"); } } }
@Override public void wire(ManagedObjectSourceWirerContext context) { context.setManagedObjectScope(ManagedObjectScope.PROCESS); } };
@Override public void wire(ManagedObjectSourceWirerContext context) { context.setManagedObjectScope(ManagedObjectScope.PROCESS); } };
@Override public void wire(ManagedObjectSourceWirerContext context) { context.setManagedObjectScope(ManagedObjectScope.PROCESS); } };
@Override public void wire(ManagedObjectSourceWirerContext context) { context.setManagedObjectScope(ManagedObjectScope.PROCESS); } };