@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; }
@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; }
@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; }
@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; }
@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);
mos.addOfficeManagedObject("mo", ManagedObjectScope.THREAD);
mos.addOfficeManagedObject("mo", ManagedObjectScope.THREAD);
this.getConnectionManagedObjectSourceClass().getName()); this.loadConnectionProperties(mos); mos.addOfficeManagedObject("mo", ManagedObjectScope.THREAD);
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), defaultHttpAccessControlName, new DefaultHttpAccessControlManagedObjectSource()); defaultHttpAccessControlMos.setTimeout(maxTimeout); defaultHttpAccessControl = defaultHttpAccessControlMos.addOfficeManagedObject(defaultHttpAccessControlName, ManagedObjectScope.PROCESS); this.officeArchitect.link(
this.getConnectionManagedObjectSourceClass().getName()); this.loadConnectionProperties(mos); mos.addOfficeManagedObject("mo", ManagedObjectScope.THREAD);
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); new AccessControlManagedObjectSource<>(this.name, accessControlType)); accessControlMos.setTimeout(this.timeout); OfficeManagedObject accessControl = accessControlMos.addOfficeManagedObject(accessControlName, ManagedObjectScope.PROCESS); if (isRequireTypeQualification) { OfficeManagedObjectSource httpAccessControlMos = office.addOfficeManagedObjectSource( httpAccessControlName, new HttpAccessControlManagedObjectSource<>(this.type)); this.httpAccessControl = httpAccessControlMos.addOfficeManagedObject(httpAccessControlName, ManagedObjectScope.PROCESS); office.link(httpAccessControl.getOfficeManagedObjectDependency("ACCESS_CONTROL"), accessControl);
.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); jpaMos.addProperty(JpaManagedObjectSource.PROPERTY_DEPENDENCY_TYPE, isConnection ? DependencyType.connection.name() : DependencyType.datasource.name()); jpaMos.addOfficeManagedObject("JPA", ManagedObjectScope.THREAD);
connectionMosClass.getName()); propertyLoader.accept(mos); mos.addOfficeManagedObject("mo", ManagedObjectScope.THREAD);
HttpSessionManagedObjectSource.class.getName()); 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);
OfficeManagedObject mo = mos.addOfficeManagedObject(managedObjectName, managedObjectScope);