@Override public OfficeManagedObject addHttpApplicationObject(Class<?> objectClass, String bindName) { // Determine if already registered bindName = getBindName(objectClass, bindName); OfficeManagedObject object = this.httpApplicationObjects.get(bindName); if (object != null) { return object; // return the already registered object } // Not registered, so register OfficeManagedObjectSource mos = this.officeArchitect.addOfficeManagedObjectSource(bindName, HttpApplicationObjectManagedObjectSource.class.getName()); mos.addProperty(HttpApplicationObjectManagedObjectSource.PROPERTY_CLASS_NAME, objectClass.getName()); if ((bindName != null) && (bindName.trim().length() > 0)) { mos.addProperty(HttpApplicationObjectManagedObjectSource.PROPERTY_BIND_NAME, bindName); } object = mos.addOfficeManagedObject(bindName, ManagedObjectScope.PROCESS); this.httpApplicationObjects.put(bindName, object); // Return the object return object; }
mos.addProperty(ClassManagedObjectSource.CLASS_NAME_PROPERTY_NAME, classManagedObjectSourceClass); mos.setTimeout(timeout); architect.link(mos.getOfficeManagedObjectFlow(flow.getName()), architect.getOfficeSection(flow.getSection()).getOfficeSectionInput(flow.getInput())); OfficeManagedObject mo = mos.addOfficeManagedObject(managedObjectName, managedObjectScope);
authenticationContextName, new AuthenticationContextManagedObjectSource<>(this.name, this.security)); authenticationContextMos.setTimeout(this.timeout); office.link(authenticationContextMos.getOfficeManagedObjectFlow("AUTHENTICATE"), this.section.getOfficeSectionInput("ManagedObjectAuthenticate")); office.link(authenticationContextMos.getOfficeManagedObjectFlow("LOGOUT"), this.section.getOfficeSectionInput("ManagedObjectLogout")); OfficeManagedObject authenticationContext = authenticationContextMos .addOfficeManagedObject(authenticationContextName, ManagedObjectScope.PROCESS); if (isRequireTypeQualification) { authenticationContext.addTypeQualification(this.name, AuthenticationContext.class.getName()); OfficeManagedObjectSource authenticationMos = office.addOfficeManagedObjectSource(authenticationName, new AuthenticationManagedObjectSource<>(this.name, this.security, this.type)); OfficeManagedObject authentication = authenticationMos.addOfficeManagedObject(authenticationName, ManagedObjectScope.PROCESS); office.link(authentication.getOfficeManagedObjectDependency("AUTHENTICATION_CONTEXT"), OfficeManagedObjectSource httpAuthenticationMos = office.addOfficeManagedObjectSource( httpAuthenticationName, new HttpAuthenticationManagedObjectSource<>(this.type)); this.httpAuthentication = httpAuthenticationMos.addOfficeManagedObject(httpAuthenticationName, ManagedObjectScope.PROCESS); office.link(this.httpAuthentication.getOfficeManagedObjectDependency("AUTHENTICATION"), authentication); OfficeManagedObjectSource accessControlMos = office.addOfficeManagedObjectSource(accessControlName, new AccessControlManagedObjectSource<>(this.name, accessControlType)); accessControlMos.setTimeout(this.timeout); OfficeManagedObject accessControl = accessControlMos.addOfficeManagedObject(accessControlName, ManagedObjectScope.PROCESS);
@Override public OfficeManagedObject addHttpObject(Class<?> objectClass, String... acceptedContentTypes) { // Determine if already registered OfficeManagedObject object = this.httpObjects.get(objectClass); if (object == null) { // Not registered, so register OfficeManagedObjectSource mos = this.officeArchitect.addOfficeManagedObjectSource(objectClass.getName(), new HttpObjectManagedObjectSource<>(objectClass, acceptedContentTypes, this.singletonObjectParserList)); object = mos.addOfficeManagedObject(objectClass.getName(), ManagedObjectScope.PROCESS); this.httpObjects.put(objectClass, object); } // Return the object return object; }
HttpChallengeContext.class.getSimpleName(), new HttpChallengeContextManagedObjectSource()); OfficeManagedObject httpChallengeContext = httpChallengeContextMos .addOfficeManagedObject(HttpChallengeContext.class.getSimpleName(), ManagedObjectScope.PROCESS); new DefaultHttpAuthenticationManagedObjectSource(negotiator, httpSecurityNames)); defaultHttpAuthentication = defaultHttpAuthenticationMos .addOfficeManagedObject(defaultHttpAuthenticationName, ManagedObjectScope.PROCESS); for (HttpSecurityBuilderImpl<?, ?, ?, ?, ?> security : this.securities) { this.officeArchitect.link(defaultHttpAuthentication.getOfficeManagedObjectDependency(security.name), OfficeManagedObjectSource defaultHttpAccessControlMos = this.officeArchitect.addOfficeManagedObjectSource( defaultHttpAccessControlName, new DefaultHttpAccessControlManagedObjectSource()); defaultHttpAccessControlMos.setTimeout(maxTimeout); defaultHttpAccessControl = defaultHttpAccessControlMos.addOfficeManagedObject(defaultHttpAccessControlName, ManagedObjectScope.PROCESS); this.officeArchitect.link(
@Override public OfficeManagedObject addHttpArgument(String parameterName, HttpValueLocation location) { // Obtain the bind name String bindName = "HTTP_" + (location == null ? "ANY" : location.name()) + "_" + parameterName; OfficeManagedObject object = this.httpArguments.get(bindName); if (object != null) { return object; // return the already register object } // Not registered, so register OfficeManagedObjectSource mos = this.officeArchitect.addOfficeManagedObjectSource(bindName, new HttpArgumentManagedObjectSource(parameterName, location)); object = mos.addOfficeManagedObject(bindName, ManagedObjectScope.PROCESS); this.httpArguments.put(bindName, object); // Return the object return object; }
httpSessionMos.setTimeout(10 * 1000); // TODO make configurable httpSessionMos.addOfficeManagedObject("HTTP_SESSION", ManagedObjectScope.PROCESS); .addOfficeManagedObjectSource("HTTP_APPLICATION_STATE", new HttpApplicationStateManagedObjectSource(this.contextPath)) .addOfficeManagedObject("HTTP_APPLICATION_STATE", ManagedObjectScope.PROCESS); this.officeArchitect .addOfficeManagedObjectSource("HTTP_REQUEST_STATE", new HttpRequestStateManagedObjectSource(argumentParsers)) .addOfficeManagedObject("HTTP_REQUEST_STATE", ManagedObjectScope.PROCESS); this.objectResponderFactories); this.officeArchitect.addOfficeManagedObjectSource("OBJECT_RESPONSE", objectResponseMos) .addOfficeManagedObject("OBJECT_RESPONSE", ManagedObjectScope.PROCESS); this.routing.setHttpEscalationHandler(objectResponseMos);
@Override public OfficeManagedObject addHttpRequestObject(Class<?> objectClass, boolean isLoadParameters, String bindName) { // Determine if already registered bindName = getBindName(objectClass, bindName); OfficeManagedObject object = this.httpRequestObjects.get(bindName); if (object == null) { // Not registered, so register OfficeManagedObjectSource mos = this.officeArchitect.addOfficeManagedObjectSource(bindName, HttpRequestObjectManagedObjectSource.class.getName()); mos.addProperty(HttpRequestObjectManagedObjectSource.PROPERTY_CLASS_NAME, objectClass.getName()); if ((bindName != null) && (bindName.trim().length() > 0)) { mos.addProperty(HttpRequestObjectManagedObjectSource.PROPERTY_BIND_NAME, bindName); } object = mos.addOfficeManagedObject(bindName, ManagedObjectScope.PROCESS); this.httpRequestObjects.put(bindName, object); // Determine if load HTTP parameters if (isLoadParameters) { // Add the property to load parameters mos.addProperty(HttpRequestObjectManagedObjectSource.PROPERTY_IS_LOAD_HTTP_PARAMETERS, String.valueOf(true)); } } // Return the object return object; }
mos.addOfficeManagedObject("mo", ManagedObjectScope.THREAD);
@Override public OfficeManagedObject addHttpSessionObject(Class<?> objectClass, String bindName) { // Determine if already registered bindName = getBindName(objectClass, bindName); OfficeManagedObject object = this.httpSessionObjects.get(bindName); if (object != null) { return object; // return the already registered object } // Not registered, so register OfficeManagedObjectSource mos = this.officeArchitect.addOfficeManagedObjectSource(bindName, HttpSessionObjectManagedObjectSource.class.getName()); mos.addProperty(HttpSessionObjectManagedObjectSource.PROPERTY_CLASS_NAME, objectClass.getName()); if ((bindName != null) && (bindName.trim().length() > 0)) { mos.addProperty(HttpSessionObjectManagedObjectSource.PROPERTY_BIND_NAME, bindName); } object = mos.addOfficeManagedObject(bindName, ManagedObjectScope.PROCESS); this.httpSessionObjects.put(bindName, object); // Return the object return object; }
mos.addOfficeManagedObject("mo", ManagedObjectScope.THREAD);
this.loadConnectionProperties(mos); mos.addProperty(AbstractConnectionManagedObjectSource.PROPERTY_DATA_SOURCE_VALIDATE_SQL, "INSERT INTO OFFICE_FLOOR_JDBC_TEST ( ID, NAME ) VALUES ( 1, 'test' )"); mos.addOfficeManagedObject("mo", ManagedObjectScope.THREAD);
this.getConnectionManagedObjectSourceClass().getName()); this.loadConnectionProperties(mos); mos.addOfficeManagedObject("mo", ManagedObjectScope.THREAD);
.addOfficeManagedObjectSource("connection", ConnectionManagedObjectSource.class.getName()); this.loadDatabaseProperties(connectionMos); connectionMos.addOfficeManagedObject("connection", ManagedObjectScope.THREAD); .addOfficeManagedObjectSource("dataSource", DataSourceManagedObjectSource.class.getName()); this.loadDatabaseProperties(dataSourceMos); dataSourceMos.addOfficeManagedObject("dataSource", ManagedObjectScope.THREAD); this.getJpaManagedObjectSourceClass().getName()); this.loadJpaProperties(jpaMos); jpaMos.addProperty(JpaManagedObjectSource.PROPERTY_DEPENDENCY_TYPE, isConnection ? DependencyType.connection.name() : DependencyType.datasource.name()); jpaMos.addOfficeManagedObject("JPA", ManagedObjectScope.THREAD);
this.getConnectionManagedObjectSourceClass().getName()); this.loadConnectionProperties(mos); mos.addOfficeManagedObject("mo", ManagedObjectScope.THREAD);
connectionMosClass.getName()); propertyLoader.accept(mos); mos.addOfficeManagedObject("mo", ManagedObjectScope.THREAD);