@Override public void beginTask(Runnable task) { // Invoke process to execute the task this.executeContext.invokeProcess(this.sslTaskFlowIndex, task, null, 0); }
/** * Obtains the {@link Properties} for the {@link InitialDirContext}. * * @param context * {@link ManagedObjectSourceContext}. * @return {@link Properties}. * @throws Exception * If fails to obtain the {@link Properties}. */ protected Properties getProperties(ManagedObjectSourceContext<None> context) throws Exception { return context.getProperties(); }
@Override protected void loadMetaData(MetaDataContext<None, None> context) throws Exception { ManagedObjectSourceContext<None> mosContext = context .getManagedObjectSourceContext(); // Obtain the algorithm this.algorithm = mosContext.getProperty(PROPERTY_ALGORITHM, null); // Provide meta-data context.setObjectClass(CredentialStore.class); }
@Override protected void loadMetaData(MetaDataContext<Dependencies, None> context) throws Exception { ManagedObjectSourceContext<None> mosContext = context .getManagedObjectSourceContext(); // Obtain the class loader this.classLoader = mosContext.getClassLoader(); // Provide meta-data context.setObjectClass(CometPublisher.class); context.setManagedObjectClass(CometPublisherManagedObject.class); context.addDependency(Dependencies.COMET_SERVICE, CometService.class); }
@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<DependencyKeys, None> context) throws Exception { ManagedObjectSourceContext<None> mosContext = context .getManagedObjectSourceContext(); // Obtain the token name this.sessionTokenName = mosContext.getProperty( HttpSessionManagedObjectSource.PROPERTY_SESSION_ID_COOKIE_NAME, HttpSessionManagedObjectSource.DEFAULT_SESSION_ID_COOKIE_NAME); // Load the meta-data context.setObjectClass(HttpSession.class); context.setManagedObjectClass(ServletHttpSessionManagedObject.class); context.addDependency(DependencyKeys.SERVLET_BRIDGE, ServletBridge.class); }
@Override protected void loadMetaData(MetaDataContext<None, None> context) throws Exception { ManagedObjectSourceContext<None> mosContext = context .getManagedObjectSourceContext(); // Obtain the properties for the directory context this.properties = this.getProperties(mosContext); // Obtain the sub context name this.subContextName = mosContext.getProperty(PROPERTY_SUB_CONTEXT_NAME, null); // Load the meta-data context.setObjectClass(DirContext.class); }
/** * Triggers a {@link ProcessState} to service the {@link Connection}. * * @param connectionHandler * {@link TcpConnectionHandler} for the {@link ConnectException}. */ public void serviceConnection(TcpConnectionHandler connectionHandler) { // Invokes the process to service the connection this.executeContext.invokeProcess(this.newConnectionFlowIndex, connectionHandler, connectionHandler, 0); }
@Override protected Properties getProperties(ManagedObjectSourceContext<None> context) throws Exception { // Obtain the properties Properties properties = context.getProperties(); // Add LDAP details properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); // Return the properties return properties; }
@Override protected void loadMetaData(MetaDataContext<DependencyKeys, None> context) throws Exception { ManagedObjectSourceContext<None> mosContext = context .getManagedObjectSourceContext(); // Obtain the dependency type String typeName = mosContext.getProperty(PROPERTY_TYPE_NAME); this.type = mosContext.loadClass(typeName); // Specify meta-data context.setObjectClass(this.type); context.setManagedObjectClass(ServletDependencyManagedObject.class); context.addDependency(DependencyKeys.SERVLET_BRIDGE, ServletBridge.class); }
@Override protected void loadMetaData(MetaDataContext<None, None> context) throws Exception { ManagedObjectSourceContext<None> mosContext = context .getManagedObjectSourceContext(); // Obtain the password file path String path = mosContext.getProperty(PROPERTY_PASSWORD_FILE_PATH); // Create the password file credential store PasswordFile file = PasswordFileCredentialStore .loadPasswordFile(new File(path)); this.credentialStore = new PasswordFileCredentialStore(file); // Specify meta-data context.setObjectClass(CredentialStore.class); }
/** * Services the {@link HttpRequest}. * * @param handler * {@link HttpConnectionHandler}. * @param httpManagedObject * {@link HttpManagedObject} for the {@link HttpRequest}. */ public void serviceHttpRequest(HttpConnectionHandler handler, HttpManagedObject httpManagedObject) { // Invoke processing of the HTTP managed object this.executeContext.invokeProcess(this.requestHandlingFlowIndex, httpManagedObject.getServerHttpConnection(), httpManagedObject, 0, httpManagedObject.getEscalationHandler()); }
@Override protected void loadMetaData(MetaDataContext<Dependencies, None> context) throws Exception { ManagedObjectSourceContext<None> mosContext = context .getManagedObjectSourceContext(); // Obtain the class String className = mosContext.getProperty(PROPERTY_CLASS_NAME); this.objectClass = mosContext.loadClass(className); // Obtain the overridden bind name this.bindName = mosContext.getProperty(PROPERTY_BIND_NAME, null); // Specify the meta-data context.setObjectClass(this.objectClass); context.setManagedObjectClass(HttpApplicationObjectManagedObject.class); context.addDependency(Dependencies.HTTP_APPLICATION_STATE, HttpApplicationState.class); }
@Override public synchronized void logout(HttpLogoutRequest logoutRequest) { // Clear the security this.security = null; // New managed object (stop overwrite of asynchronous listener) // (Not used for execution but need to provide an instance) HttpAuthenticationManagedObject<S, C> executeManagedObject = new HttpAuthenticationManagedObject<S, C>(null, null); // Trigger logout this.executeContext.invokeProcess(Flows.LOGOUT, new TaskLogoutContextImpl(logoutRequest, this.connection, this.session), executeManagedObject, 0); }
@Override protected void loadMetaData( MetaDataContext<HttpSessionAttributeRetrieverDependencies, None> context) throws Exception { ManagedObjectSourceContext<None> mosContext = context .getManagedObjectSourceContext(); // Obtain the type for being returned String typeName = mosContext.getProperty(PROPERTY_TYPE_NAME); Class<?> type = mosContext.loadClass(typeName); // Load the meta-data context.setManagedObjectClass(HttpSessionAttributeRetrieverManagedObject.class); context.setObjectClass(type); context.addDependency( HttpSessionAttributeRetrieverDependencies.HTTP_SESSION_OBJECT, HttpSessionAttribute.class); }
/** * Runs the loop for checking for expiring. */ private synchronized void expireCheckLoop() { // Undertake an expire this.expire(); // Determine if continue checking if (this.executeContext == null) { return; // stopping, so no further checking } // Setup for next expire check this.executeContext.invokeProcess(Flows.EXPIRE, null, new CometServiceManagedObject(this), this.expireCheckInterval); }
@Override protected void loadMetaData( MetaDataContext<JndiObjectDependency, None> context) throws Exception { ManagedObjectSourceContext<None> mosContext = context .getManagedObjectSourceContext(); // Obtain the JNDI name this.jndiName = mosContext.getProperty(PROPERTY_JNDI_NAME); // Obtain the Object Type String objectTypeName = mosContext.getProperty(PROPERTY_OBJECT_TYPE); Class<?> objectType = mosContext.loadClass(objectTypeName); // Load the meta-data context.setManagedObjectClass(JndiObjectManagedObject.class); context.setObjectClass(objectType); // Specify depends on Context context.addDependency(JndiObjectDependency.CONTEXT, Context.class); }
@Override protected void loadMetaData(MetaDataContext<DependencyKeys, None> context) throws Exception { ManagedObjectSourceContext<None> mosContext = context .getManagedObjectSourceContext(); // Obtain the properties this.algorithm = mosContext.getProperty(PROPERTY_ALGORITHM); this.entrySearchBaseDn = mosContext .getProperty(PROPERTY_ENTRY_SEARCH_BASE_DN); this.rolesSearchBaseDn = mosContext .getProperty(PROPERTY_ROLES_SEARCH_BASE_DN); // Add dependency on DirContext context.addDependency(DependencyKeys.DIR_CONTEXT, DirContext.class); // Specify details of object context.setObjectClass(CredentialStore.class); context.setManagedObjectClass(JndiLdapManagedObject.class); }
@Override @SuppressWarnings("unchecked") protected void loadMetaData(MetaDataContext<Dependencies, None> context) throws Exception { ManagedObjectSourceContext<None> mosContext = context .getManagedObjectSourceContext(); // Obtain the proxy interface String proxyInterfaceName = mosContext .getProperty(PROPERTY_PROXY_INTERFACE); this.proxyInterface = (Class<? extends CometSubscriber>) mosContext .loadClass(proxyInterfaceName); // Provide meta-data context.setObjectClass(this.proxyInterface); context.setManagedObjectClass(CometProxyPublisherManagedObject.class); context.addDependency(Dependencies.COMET_PUBLISHER, CometPublisher.class); }
@Override protected void loadMetaData(MetaDataContext<Dependencies, None> context) throws Exception { ManagedObjectSourceContext<None> mosContext = context .getManagedObjectSourceContext(); // Create the resource locator String classPathPrefix = mosContext.getProperty( PROPERTY_CLASS_PATH_PREFIX, WebAutoWireApplication.WEB_PUBLIC_RESOURCES_CLASS_PATH_PREFIX); ClassLoader classLoader = mosContext.getClassLoader(); this.resourceLocator = new ClassPathResourceLocator(classPathPrefix, classLoader); // Specify meta-data context.setObjectClass(ServletServer.class); context.setManagedObjectClass(ServletServerManagedObject.class); // Specify dependencies context.addDependency(Dependencies.HTTP_APPLICATION_LOCATION, HttpApplicationLocation.class); }