@Override public String getType() { return serviceContext.getServiceType(); }
@Override public String getServiceType() { return serviceContext.getServiceType(); }
@Override public boolean equals(Object otherObject) { if (otherObject instanceof ServiceContext) { ServiceContext otherServiceContext = (ServiceContext) otherObject; if (this.serviceType.equals(otherServiceContext.getServiceType())) { Collection<String> otherAccepts = otherServiceContext.getAccepts(); for (String uri : this.accepts) { if (!otherAccepts.contains(uri)) { return false; } } // same type, same accepts, return true return true; } } return false; }
public UpdateCheckServiceManagementBean(GatewayManagementBean gatewayManagementBean, ServiceContext serviceContext) { super(gatewayManagementBean, serviceContext); final ManagementUpdateCheck updateCheckListener = gatewayManagementBean.getUpdateCheck(); if (updateCheckListener != null) { assert (serviceContext.getServiceType().equals("update.check")); Map<String, Object> serviceSpecificObjects = serviceContext.getServiceSpecificObjects(); serviceSpecificObjects.put(MANAGEMENT_UPDATE_CHECK_LISTENER, updateCheckListener); } }
/** * Create a ServiceManagementBean for a resource address on the local Gateway instance. * <p/> * XXX We need to do something more if we're going to support some idea of storing services from another Gateway instance in * the same repository, as we won't generally have ServiceContext to work with (since the other instance will be in a * different process, perhaps on a different machine.) */ @Override public void addServiceManagementBean(ServiceContext serviceContext) { GatewayManagementBean gatewayManagementBean = getLocalGatewayManagementBean(); ServiceManagementBean serviceManagementBean = serviceManagmentBeanFactory.newServiceManagementBean( serviceContext.getServiceType(), gatewayManagementBean, serviceContext); ServiceManagementBean tempBean = serviceManagementBeans.putIfAbsent(serviceContext, serviceManagementBean); if (tempBean == null) { // A bean was not already created for this service for (ManagementServiceHandler handler : managementServiceHandlers) { handler.addServiceManagementBean(serviceManagementBean); } } }
logger.warn(String.format( "Configured prepared.connection.count %d for %s service has been increased to number of IO threads %d for extra efficiency", preparedConnectionCount, serviceCtx.getServiceType(), workerCount)); serviceCtx.getServiceType(), preparedConnectionCount));