/** * Create a ServiceGroupContext for the specified service group, and notify any registered * ContextListener. * * @param serviceGroup an AxisServiceGroup * @return a new ServiceGroupContext */ public ServiceGroupContext createServiceGroupContext(AxisServiceGroup serviceGroup) { ServiceGroupContext sgCtx = new ServiceGroupContext(this, serviceGroup); contextCreated(sgCtx); return sgCtx; }
private static ServiceContext fillServiceContextAndServiceGroupContext(AxisService axisService, ConfigurationContext configurationContext) throws AxisFault { String serviceGroupContextId = UIDGenerator.generateURNString(); ServiceGroupContext serviceGroupContext = configurationContext.createServiceGroupContext(axisService.getAxisServiceGroup()); serviceGroupContext.setId(serviceGroupContextId); configurationContext.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext); return serviceGroupContext.getServiceContext(axisService); }
private void cleanupServiceContextes(ServiceGroupContext serviceGroupContext) { Iterator<ServiceContext> serviceContecxtes = serviceGroupContext.getServiceContexts(); while (serviceContecxtes.hasNext()) { ServiceContext serviceContext = (ServiceContext) serviceContecxtes.next(); DependencyManager.destroyServiceObject(serviceContext); } }
/** * This will do a copy of the properties from this context object * to the properties of the specified context object. * * @param context The ServiceGroupContext object to hold the merged properties */ public void putContextProperties(ServiceGroupContext context) { if (context != null) { // get the current properties on this context object Map<String, Object> props = getProperties(); // copy them to the specified context object context.mergeProperties(props); } }
/** * Adds the given ServiceGroupContext into the SOAP session table * * @param serviceGroupContext ServiceGroup Context to add */ public void addServiceGroupContextIntoSoapSessionTable( ServiceGroupContext serviceGroupContext) { String id = serviceGroupContext.getId(); serviceGroupContextMap.put(id, serviceGroupContext); serviceGroupContext.touch(); serviceGroupContext.setParent(this); // this is the best time to clean up the SGCtxts since are not being used anymore cleanupServiceGroupContexts(); }
if (!this.axisServiceGroup.equals(ctx.getDescription())) { return false; String ctxid = ctx.getId();
public static OperationClient getOperationClient(BPELMessageContext partnerMessageContext, ConfigurationContext clientConfigCtx) throws AxisFault { AxisService anonymousService = AnonymousServiceFactory.getAnonymousService(partnerMessageContext.getService(), partnerMessageContext.getPort(), clientConfigCtx.getAxisConfiguration(), partnerMessageContext.getCaller()); anonymousService.engageModule(clientConfigCtx.getAxisConfiguration().getModule("UEPModule")); anonymousService.getParent().addParameter( BPELConstants.HIDDEN_SERVICE_PARAM, "true"); ServiceGroupContext sgc = new ServiceGroupContext( clientConfigCtx, (AxisServiceGroup) anonymousService.getParent()); ServiceContext serviceCtx = sgc.getServiceContext(anonymousService); // get a reference to the DYNAMIC operation of the Anonymous Axis2 service AxisOperation axisAnonymousOperation = anonymousService.getOperation( partnerMessageContext.isTwoWay() ? ServiceClient.ANON_OUT_IN_OP : ServiceClient.ANON_OUT_ONLY_OP); Options clientOptions = cloneOptions(partnerMessageContext.getInMessageContext().getOptions()); clientOptions.setExceptionToBeThrownOnSOAPFault(false); /* This value doesn't overrideend point config. */ clientOptions.setTimeOutInMilliSeconds(60000); return axisAnonymousOperation.createClient(serviceCtx, clientOptions); }
configurationContext.getAxisConfiguration().getService(serviceName); validateAxisService(axisService); ServiceContext serviceContext = sgCtx.getServiceContext(axisService); propertyUpdater.updateProperties(serviceContext); } catch (AxisFault e) { return; sgCtx = new ServiceGroupContext(configurationContext, serviceGroup); sgCtx.setId(serviceGroupContextId); if (scope.equals(Constants.SCOPE_APPLICATION)) { configurationContext. ServiceContext serviceContext = sgCtx.getServiceContext(axisService); propertyUpdater.updateProperties(serviceContext); } catch (AxisFault axisFault) {
/** * Configure the ServiceClient to interact with the Web service described by the specified * AxisService object. * * @param axisService the AxisService that represents the new Web service. * @throws AxisFault if an error occurs while configuring the ServiceClient. */ public void setAxisService(AxisService axisService) throws AxisFault { if (axisService == null) { // AxisFault? throw new IllegalArgumentException("AxisService is null"); } synchronized (this.axisConfig) { axisConfig.removeService(this.axisService.getName()); this.axisService = axisService; axisService.setClientSide(true); axisConfig.addService(axisService); } AxisServiceGroup axisServiceGroup = axisService.getAxisServiceGroup(); ServiceGroupContext serviceGroupContext = configContext.createServiceGroupContext(axisServiceGroup); this.serviceContext = serviceGroupContext.getServiceContext(axisService); }
public void execute(ConfigurationContext configContext) throws ClusteringFault { ServiceGroupContext sgCtx = configContext.getServiceGroupContext(serviceGroupContextId); // If the ServiceGroupContext is not found, create it if (sgCtx == null) { AxisServiceGroup axisServiceGroup = configContext.getAxisConfiguration().getServiceGroup(serviceGroupName); if(axisServiceGroup == null){ return; } sgCtx = new ServiceGroupContext(configContext, axisServiceGroup); sgCtx.setId(serviceGroupContextId); configContext.addServiceGroupContextIntoSoapSessionTable(sgCtx); // TODO: Check this } if (log.isDebugEnabled()) { log.debug("Gonna update SG prop in " + serviceGroupContextId + "===" + sgCtx); } propertyUpdater.updateProperties(sgCtx); }
AxisServiceGroup serviceGroup = serviceGroupContext.getDescription(); Iterator<AxisService> serviceItr = serviceGroup.getServices(); while (serviceItr.hasNext()) { AxisService axisService = (AxisService) serviceItr.next(); ServiceContext serviceContext = serviceGroupContext.getServiceContext(axisService); AxisService service = serviceContext.getAxisService(); ClassLoader classLoader = service.getClassLoader();
String groupName = metaParent.getId(); metaParent.activate(cc); metaParent.putContextProperties(existingSGC); serviceGroupContext.addServiceContext(this); metaParent.addServiceContext(this);
public void setServiceGroupContext(ServiceGroupContext serviceGroupContext) { // allow the service group context to be set to null // this allows the message context object to be extraced from // the object graph this.serviceGroupContext = serviceGroupContext; if (this.serviceGroupContext != null) { this.axisServiceGroup = serviceGroupContext.getDescription(); } }
/** * Returns a name associated with the ServiceGroupContext * associated with this ServiceContext. * * @return The name string, or null if no name can be found */ public String getGroupName() { if (serviceGroupContext != null) { return serviceGroupContext.getId(); } if (metaParent != null) { return metaParent.getId(); } return null; }
out.writeLong(getLastTouchedTime()); out.writeMap(getProperties());
public void logout() throws AxisFault { MessageContext.getCurrentMessageContext(). getServiceGroupContext().getProperties().clear(); }
/** * This has used to test if the server is availabele and the current admins login status. * * @return boolean */ public boolean ping() { MessageContext msgCtx = MessageContext.getCurrentMessageContext(); ServiceGroupContext serviceGroupContext = msgCtx.getServiceGroupContext(); Object property = serviceGroupContext.getProperty(ServerConstants.ADMIN_LOGGED_IN); if (property == null) { return false; } else { String status = (String) property; return JavaUtils.isTrue(status); } } }
public ServiceGroupContext(ConfigurationContext parent, AxisServiceGroup axisServiceGroup) { super(parent); this.axisServiceGroup = axisServiceGroup; serviceContextMap = new HashMap<String, ServiceContext>(); // initially set the id to the axisServiceGroup if (axisServiceGroup != null) { setId(axisServiceGroup.getServiceGroupName()); } }
endpointDefinition.isSecurityOn(), false); anonymousService.getParent().addParameter(SynapseConstants.HIDDEN_SERVICE_PARAM, "true"); ServiceGroupContext serviceGroupContext = new ServiceGroupContext(configurationContext, (AxisServiceGroup) anonymousService.getParent()); ServiceContext serviceCtx = serviceGroupContext.getServiceContext(anonymousService); axisOutMsgCtx.setServiceContext(serviceCtx);
configurationContext.getAxisConfiguration().getService(serviceName); validateAxisService(axisService); ServiceContext serviceContext = sgCtx.getServiceContext(axisService); propertyUpdater.updateProperties(serviceContext); } catch (AxisFault e) { return; sgCtx = new ServiceGroupContext(configurationContext, serviceGroup); sgCtx.setId(serviceGroupContextId); if (scope.equals(Constants.SCOPE_APPLICATION)) { configurationContext. ServiceContext serviceContext = sgCtx.getServiceContext(axisService); propertyUpdater.updateProperties(serviceContext); } catch (AxisFault axisFault) {