/** * 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; }
AutoWireObject object = source.addManagedObject( HttpsServerSocketManagedObjectSource.class.getName(), wirer, new AutoWire(ServerHttpConnection.class));