.addFlow(ServerHttpConnection.class) .setLabel("HANDLE_HTTP_REQUEST").getIndex();
@Override protected void loadMetaData(MetaDataContext<None, Flows> context) throws Exception { ManagedObjectSourceContext<Flows> mosContext = context .getManagedObjectSourceContext(); // Obtain the expire check interval this.expireCheckInterval = Long.parseLong(mosContext.getProperty( PROPERTY_EXPIRE_CHECK_INTERVAL, String.valueOf(DEFAULT_EXPIRE_CHECK_INTERVAL))); // Obtain the event timeout this.eventTimeout = Long.parseLong(mosContext.getProperty( PROPERTY_EVENT_TIMEOUT, String.valueOf(DEFAULT_EVENT_TIMEOUT))); // Obtain the request timeout this.requestTimeout = Long.parseLong(mosContext.getProperty( PROPERTY_REQUEST_TIMEOUT, String.valueOf(DEFAULT_REQUEST_TIMEOUT))); // Specify meta-data context.setObjectClass(CometService.class); context.setManagedObjectClass(CometServiceManagedObject.class); // Provide task to trigger expire ExpireTask factory = new ExpireTask(); mosContext.addWork("EXPIRE", factory).addTask("TASK", factory) .setTeam(EXPIRE_TEAM_NAME); context.addFlow(Flows.EXPIRE, null); mosContext.linkProcess(Flows.EXPIRE, "EXPIRE", "TASK"); }
@Override protected void loadMetaData(MetaDataContext<None, FlowKeys> context) throws Exception { ManagedObjectSourceContext<FlowKeys> mosContext = context .getManagedObjectSourceContext(); // Obtain the instance identifier String instanceIdentifier = mosContext .getProperty(PROPERTY_INSTANCE_IDENTIFIER); // Register this instance synchronized (ServletBridgeManagedObjectSource.class) { instances.put(instanceIdentifier, this); } // Specify the meta-data context.setObjectClass(ServletBridge.class); context.addFlow(FlowKeys.SERVICE, null); // Determine if using async boolean isUseAsync = Boolean.parseBoolean(mosContext.getProperty( PROPERTY_USE_ASYNC, String.valueOf(Boolean.FALSE))); if (isUseAsync) { // Register recycle task to complete the async context CompleteAsyncContextTask recycleTask = new CompleteAsyncContextTask(); recycleTask.registerAsRecycleTask(mosContext, "COMPLETE"); } }
this.sslTaskFlowIndex = configurationContext.addFlow(Runnable.class) .setLabel("SSL_TASKS").getIndex(); SslTaskWork sslTaskExecution = new SslTaskWork();
@Override public CommunicationProtocol createCommunicationProtocol( MetaDataContext<None, Indexed> configurationContext, CommunicationProtocolContext protocolContext) throws Exception { ManagedObjectSourceContext<Indexed> mosContext = configurationContext .getManagedObjectSourceContext(); // Obtain the maximum idle time this.maxIdleTime = Long.parseLong(mosContext.getProperty( PROPERTY_MAXIMUM_IDLE_TIME, String.valueOf(DEFAULT_MAXIMUM_IDLE_TIME))); // Obtain the send buffer size this.sendBufferSize = protocolContext.getSendBufferSize(); // Specify types configurationContext.setManagedObjectClass(TcpConnectionHandler.class); configurationContext.setObjectClass(ServerTcpConnection.class); // Provide the flow to process a new connection this.newConnectionFlowIndex = configurationContext .addFlow(ServerTcpConnection.class).setLabel("NEW_CONNECTION") .getIndex(); // Ensure connection is cleaned up when process finished new CleanupTask().registerAsRecycleTask(mosContext, "cleanup"); // Return this as the server socket handler return this; }
@Override protected void loadMetaData(MetaDataContext<Dependencies, Flows> context) throws Exception { ManagedObjectSourceContext<Flows> mosContext = context .getManagedObjectSourceContext(); // Retrieve the HTTP Security Source String key = mosContext.getProperty(PROPERTY_HTTP_SECURITY_SOURCE_KEY); this.httpSecuritySource = HttpSecurityConfigurator .getHttpSecuritySource(key).getHttpSecuritySource(); // Provide the meta-data context.setObjectClass(HttpAuthentication.class); context.setManagedObjectClass(HttpAuthenticationManagedObject.class); context.addDependency(Dependencies.SERVER_HTTP_CONNECTION, ServerHttpConnection.class); context.addDependency(Dependencies.HTTP_SESSION, HttpSession.class); context.addFlow(Flows.AUTHENTICATE, TaskAuthenticateContext.class); context.addFlow(Flows.LOGOUT, TaskLogoutContext.class); }