@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); }
/** * 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, 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"); }
String typeName = mosContext.getProperty(PROPERTY_TYPE_NAME); Class<?> type = mosContext.loadClass(typeName); .parseBoolean(mosContext.getProperty(PROPERTY_CASE_INSENSITIVE, Boolean.toString(true))); for (String name : mosContext.getProperties().stringPropertyNames()) { String parameterName = mosContext.getProperty(name);
String sslEngineSourceClassName = mosContext.getProperty( PROPERTY_SSL_ENGINE_SOURCE, null); if (sslEngineSourceClassName == null) { } else { this.sslEngineSource = (SslEngineSource) mosContext.loadClass( sslEngineSourceClassName).newInstance(); .setLabel("SSL_TASKS").getIndex(); SslTaskWork sslTaskExecution = new SslTaskWork(); ManagedObjectWorkBuilder<SslTaskWork> work = mosContext.addWork( "SSL_TASK_EXECUTOR", sslTaskExecution); ManagedObjectTaskBuilder<SslTaskDependencies, None> task = work task.linkParameter(SslTaskDependencies.TASK, Runnable.class); task.setTeam("SSL_TASKS"); mosContext.linkProcess(this.sslTaskFlowIndex, "SSL_TASK_EXECUTOR", "SSL_TASK_EXECUTOR");
@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); }
.parseBoolean(mosContext.getProperty( PROPERTY_IS_SEND_STACK_TRACE_ON_FAILURE, String.valueOf(DEFAULT_VALUE_IS_SEND_STACK_TRACE_ON_FAILURE))); this.maximumHttpRequestHeaders = Integer.parseInt(mosContext .getProperty(PROPERTY_MAXIMUM_HTTP_REQUEST_HEADERS, String .valueOf(DEFAULT_VALUE_MAXIMUM_HTTP_REQUEST_HEADERS))); this.maximumRequestBodyLength = Long.parseLong(mosContext.getProperty( PROPERTY_MAXIMUM_REQUEST_BODY_LENGTH, String.valueOf(DEFAULT_VALUE_MAXIMUM_REQUEST_BODY_LENGTH))); this.connectionTimeout = Long.parseLong(mosContext.getProperty( PROPERTY_CONNECTION_TIMEOUT, String.valueOf(DEFAULT_VALUE_CONNECTION_TIMEOUT))); this.maxTextPartLength = Integer.parseInt(mosContext.getProperty( PROPERTY_MAXIMUM_TEXT_PART_LENGTH, String.valueOf(DEFAULT_VALUE_MAXIMUM_TEXT_PART_LENGTH))); .getResource(HttpCommunicationProtocol.class.getPackage() .getName().replace('.', '/') + "/Server.txt"); String httpServerClockSourceClassName = mosContext.getProperty( PROPERTY_HTTP_SERVER_CLOCK_SOURCE, HttpServerClockImpl.class.getName()); HttpServerClockSource httpServerClockSource = (HttpServerClockSource) mosContext .loadClass(httpServerClockSourceClassName).newInstance(); this.httpServerClock = httpServerClockSource .createHttpServerClock(configurationContext);
.getProperty(PROPERTY_SERVLET_CONTEXT_NAME); Properties properties = mosContext.getProperties(); ClassLoader classLoader = mosContext.getClassLoader();
int port = Integer.parseInt(mosContext.getProperty(PROPERTY_PORT)); this.sendBufferSize = Integer.parseInt(mosContext.getProperty( PROPERTY_SEND_BUFFER_SIZE, String.valueOf(osSendBufferSize))); int receiveBufferSize = Integer.parseInt(mosContext.getProperty( PROPERTY_RECEIVE_BUFFER_SIZE, String.valueOf(osReceiveBufferSize))); new InetSocketAddress(port), this.communicationProtocol, connectionManager, serverSocketBackLog); ManagedObjectTaskBuilder<None, None> accepterTask = mosContext.addWork( "accepter", this.serverSocketAccepter).addTask("accepter", this.serverSocketAccepter); mosContext.addStartupTask("accepter", "accepter");
@Override protected void loadMetaData(MetaDataContext<None, None> context) throws Exception { ManagedObjectSourceContext<None> mosContext = context .getManagedObjectSourceContext(); // Provide meta-data context.setManagedObjectClass(JndiContextManagedObject.class); context.setObjectClass(Context.class); // Obtain the properties this.properties = mosContext.getProperties(); // Obtain the sub context name (ensuring not blank) this.subContextName = this.properties.getProperty( PROPERTY_SUB_CONTEXT_NAME, null); if ((this.subContextName == null) || (this.subContextName.trim().length() == 0)) { // No/blank sub context name this.subContextName = null; } // Determine if validate context String validate = mosContext.getProperty(PROPERTY_VALIDATE, "false"); if (Boolean.parseBoolean(validate)) { // Obtain the Managed Object to validate Context this.getManagedObject(); } }
@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); }
mosContext.addWork("SetupAutoWireListener", dummy) .addTask("SetupAutoWireListener", dummy) .setTeam(listenerTeamName); if (mosContext.isLoadingType()) { return null; ManagedObjectTaskBuilder listenerTask = mosContext.addWork( listenerName, socketListener).addTask(listenerName, socketListener); mosContext.addStartupTask(listenerName, listenerName); ManagedObjectTaskBuilder heartBeatTask = mosContext.addWork( heartBeatName, connectionManager).addTask(heartBeatName, connectionManager); mosContext.addStartupTask(heartBeatName, heartBeatName);
@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); }
String className = mosContext.getProperty(PROPERTY_CLASS_NAME); this.objectClass = mosContext.loadClass(className); this.bindName = mosContext.getProperty(PROPERTY_BIND_NAME, null); boolean isLoadParameters = Boolean.parseBoolean(mosContext.getProperty( PROPERTY_IS_LOAD_HTTP_PARAMETERS, String.valueOf(false))); if (isLoadParameters) { .getProperty(PROPERTY_CASE_INSENSITIVE, Boolean.toString(true))); for (String name : mosContext.getProperties().stringPropertyNames()) { String parameterName = mosContext.getProperty(name);
@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<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); }
this.domain = mosContext.getProperty(PROPERTY_DOMAIN, null); this.httpPort = Integer.parseInt(mosContext.getProperty( PROPERTY_HTTP_PORT, String.valueOf(DEFAULT_HTTP_PORT))); this.httpsPort = Integer.parseInt(mosContext.getProperty( PROPERTY_HTTPS_PORT, String.valueOf(DEFAULT_HTTPS_PORT))); this.contextPath = mosContext.getProperty(PROPERTY_CONTEXT_PATH, null); this.clusterHostName = mosContext.getProperty(PROPERTY_CLUSTER_HOST, null); this.clusterHttpPort = Integer.parseInt(mosContext.getProperty( PROPERTY_CLUSTER_HTTP_PORT, String.valueOf(this.httpPort))); this.clusterHttpsPort = Integer.parseInt(mosContext.getProperty( PROPERTY_CLUSTER_HTTPS_PORT, String.valueOf(this.httpsPort)));
@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<Dependencies, None> context) throws Exception { ManagedObjectSourceContext<None> mosContext = context .getManagedObjectSourceContext(); // Obtain the security type String securityTypeName = mosContext .getProperty(PROPERTY_HTTP_SECURITY_TYPE); Class<?> securityType = mosContext.loadClass(securityTypeName); // Determine if allowing null HTTP Security this.isEscalateNullHttpSecurity = Boolean.parseBoolean(mosContext .getProperty(PROPERTY_IS_ESCALATE_AUTHENTICATION_REQUIRED, String.valueOf(true))); // Specify the meta-data context.setObjectClass(securityType); context.setManagedObjectClass(HttpSecurityManagedObject.class); // Add the dependency context.addDependency(Dependencies.HTTP_AUTHENTICATION, HttpAuthentication.class); }
@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"); } }