private static void writeTypeProperty(StringBuilder buffer, Bus bus, String type) { String busId = bus.getId(); buffer.append(ManagementConstants.DEFAULT_DOMAIN_NAME).append(':'); buffer.append(ManagementConstants.BUS_ID_PROP).append('=').append(busId).append(','); buffer.append(ManagementConstants.TYPE_PROP).append('=').append(type); }
public ObjectName getObjectName() throws JMException { StringBuilder buffer = new StringBuilder(); buffer.append(ManagementConstants.DEFAULT_DOMAIN_NAME).append(':'); buffer.append(ManagementConstants.BUS_ID_PROP).append('=').append(bus.getId()).append(','); buffer.append("WorkQueueManager=").append(NAME_VALUE); buffer.append(',').append(ManagementConstants.TYPE_PROP).append('=').append(TYPE_VALUE).append(','); // Added the instance id to make the ObjectName unique buffer.append(ManagementConstants.INSTANCE_ID_PROP).append('=').append(wqManager.hashCode()); //Use default domain name of server return new ObjectName(buffer.toString()); }
public ObjectName getObjectName() throws JMException { StringBuilder buffer = new StringBuilder(); buffer.append(ManagementConstants.DEFAULT_DOMAIN_NAME).append(':'); buffer.append(ManagementConstants.BUS_ID_PROP).append('=').append(bus.getId()).append(','); buffer.append("WorkQueueManager=").append(NAME_VALUE); buffer.append(',').append(ManagementConstants.TYPE_PROP).append('=').append(TYPE_VALUE).append(','); // Added the instance id to make the ObjectName unique buffer.append(ManagementConstants.INSTANCE_ID_PROP).append('=').append(wqManager.hashCode()); //Use default domain name of server return new ObjectName(buffer.toString()); }
private ObjectName persist(ObjectName original) throws JMException { ObjectName persisted = original; if (!(persistentBusId == null || "".equals(persistentBusId) || persistentBusId.startsWith("${"))) { String originalStr = original.toString(); if (originalStr.indexOf(ManagementConstants.BUS_ID_PROP) != -1) { String persistedStr = originalStr.replaceFirst(ManagementConstants.BUS_ID_PROP + "=" + bus.getId(), ManagementConstants.BUS_ID_PROP + "=" + persistentBusId); persisted = new ObjectName(persistedStr); } } return persisted; }
public ObjectName getObjectName() throws JMException { StringBuilder buffer = new StringBuilder(); buffer.append(ManagementConstants.DEFAULT_DOMAIN_NAME).append(':'); buffer.append(ManagementConstants.BUS_ID_PROP).append('=').append(bus.getId()).append(','); buffer.append("WorkQueueManager=").append(NAME_VALUE); buffer.append(',').append(ManagementConstants.TYPE_PROP).append('=').append(TYPE_VALUE).append(','); // Added the instance id to make the ObjectName unique buffer.append(ManagementConstants.INSTANCE_ID_PROP).append('=').append(wqManager.hashCode()); //Use default domain name of server return new ObjectName(buffer.toString()); }
public ObjectName getObjectName() throws JMException { StringBuilder buffer = new StringBuilder(); buffer.append(ManagementConstants.DEFAULT_DOMAIN_NAME).append(':'); buffer.append(ManagementConstants.BUS_ID_PROP).append('=').append(bus.getId()).append(','); buffer.append("WorkQueueManager=").append(NAME_VALUE); buffer.append(',').append(ManagementConstants.TYPE_PROP).append('=').append(TYPE_VALUE).append(','); // Added the instance id to make the ObjectName unique buffer.append(ManagementConstants.INSTANCE_ID_PROP).append('=').append(wqManager.hashCode()); //Use default domain name of server return new ObjectName(buffer.toString()); }
public ObjectName getObjectName() throws JMException { StringBuilder buffer = new StringBuilder(); buffer.append(ManagementConstants.DEFAULT_DOMAIN_NAME).append(':'); if (super.getBus() != null) { buffer.append( ManagementConstants.BUS_ID_PROP).append('=').append(super.getBus().getId()).append(','); } buffer.append(ManagementConstants.TYPE_PROP).append('=').append("MemoryIdentityCache").append(','); buffer.append(ManagementConstants.NAME_PROP).append('=') .append("MemoryIdentityCache-" + System.identityHashCode(this)); return new ObjectName(buffer.toString()); } }
public ObjectName getObjectName() throws JMException { StringBuilder buffer = new StringBuilder(); buffer.append(ManagementConstants.DEFAULT_DOMAIN_NAME).append(':'); if (super.getBus() != null) { buffer.append( ManagementConstants.BUS_ID_PROP).append('=').append(super.getBus().getId()).append(','); } buffer.append(ManagementConstants.TYPE_PROP).append('=').append("EHCacheIdentityCache").append(','); buffer.append(ManagementConstants.NAME_PROP).append('=') .append("EHCacheIdentityCache-" + System.identityHashCode(this)); return new ObjectName(buffer.toString()); } }
private void registerBusAsService() { BundleContext context = bus.getExtension(BundleContext.class); if (context != null) { Properties props = new Properties(); props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, context.getBundle().getSymbolicName()); props.put(CONTEXT_VERSION_PROPERTY, getBundleVersion(context.getBundle())); props.put(CONTEXT_NAME_PROPERTY, bus.getId()); service = context.registerService(Bus.class.getName(), bus, props); } }
public ObjectName getObjectName() throws JMException { StringBuilder buffer = new StringBuilder(); buffer.append(ManagementConstants.DEFAULT_DOMAIN_NAME).append(':'); if (super.getBus() != null) { buffer.append( ManagementConstants.BUS_ID_PROP).append('=').append(super.getBus().getId()).append(','); } buffer.append(ManagementConstants.TYPE_PROP).append('=').append("MemoryIdentityCache").append(','); buffer.append(ManagementConstants.NAME_PROP).append('=') .append("MemoryIdentityCache-" + System.identityHashCode(this)); return new ObjectName(buffer.toString()); } }
public ObjectName getObjectName() throws JMException { String busId = bus.getId(); StringBuilder buffer = new StringBuilder(ManagementConstants.DEFAULT_DOMAIN_NAME).append(':'); buffer.append(ManagementConstants.BUS_ID_PROP).append('=').append(busId).append(','); buffer.append(ManagementConstants.TYPE_PROP).append('=').append(TYPE_VALUE).append(','); // Added the instance id to make the ObjectName unique String instanceId = (String)bus.getProperties().get(INSTANCE_ID); if (StringUtils.isEmpty(instanceId)) { instanceId = new StringBuilder().append(bus.hashCode()).toString(); } buffer.append(ManagementConstants.INSTANCE_ID_PROP).append('=').append(instanceId); return new ObjectName(buffer.toString()); } }
public ObjectName getObjectName() throws JMException { StringBuilder buffer = new StringBuilder(); buffer.append(ManagementConstants.DEFAULT_DOMAIN_NAME).append(':'); if (super.getBus() != null) { buffer.append( ManagementConstants.BUS_ID_PROP).append('=').append(super.getBus().getId()).append(','); } buffer.append(ManagementConstants.TYPE_PROP).append('=').append("EHCacheIdentityCache").append(','); buffer.append(ManagementConstants.NAME_PROP).append('=') .append("EHCacheIdentityCache-" + System.identityHashCode(this)); return new ObjectName(buffer.toString()); } }
private void registerBusAsService() { BundleContext context = bus.getExtension(BundleContext.class); if (context != null) { Properties props = new Properties(); props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, context.getBundle().getSymbolicName()); props.put(CONTEXT_VERSION_PROPERTY, getBundleVersion(context.getBundle())); props.put(CONTEXT_NAME_PROPERTY, bus.getId()); service = context.registerService(Bus.class.getName(), bus, props); } }
public ObjectName getObjectName() throws JMException { String busId = bus.getId(); StringBuilder buffer = new StringBuilder(ManagementConstants.DEFAULT_DOMAIN_NAME).append(':'); buffer.append(ManagementConstants.BUS_ID_PROP).append('=').append(busId).append(','); buffer.append(ManagementConstants.TYPE_PROP).append('=').append(TYPE_VALUE).append(','); // Added the instance id to make the ObjectName unique String instanceId = (String)bus.getProperties().get(INSTANCE_ID); if (StringUtils.isEmpty(instanceId)) { instanceId = new StringBuilder().append(bus.hashCode()).toString(); } buffer.append(ManagementConstants.INSTANCE_ID_PROP).append('=').append(instanceId); return new ObjectName(buffer.toString()); } }
private void registerBusAsService() { BundleContext context = bus.getExtension(BundleContext.class); if (context != null) { Map<String, Object> props = new HashMap<>(); props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, context.getBundle().getSymbolicName()); props.put(CONTEXT_VERSION_PROPERTY, getBundleVersion(context.getBundle())); props.put(CONTEXT_NAME_PROPERTY, bus.getId()); service = context.registerService(Bus.class.getName(), bus, CollectionUtils.toDictionary(props)); } }
private void registerBusAsService() { BundleContext context = bus.getExtension(BundleContext.class); if (context != null) { Map<String, Object> props = new HashMap<>(); props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, context.getBundle().getSymbolicName()); props.put(CONTEXT_VERSION_PROPERTY, getBundleVersion(context.getBundle())); props.put(CONTEXT_NAME_PROPERTY, bus.getId()); service = context.registerService(Bus.class.getName(), bus, CollectionUtils.toDictionary(props)); } }
public static String getEndpointIdentifier(Endpoint endpoint, Bus bus) { String busId = null; if (bus == null) { busId = Bus.DEFAULT_BUS_ID; } else { busId = bus.getId(); // bus-ids of form cxfnnn or artifactid-cxfnnn must drop the variable part nnn Matcher m = GENERATED_BUS_ID_PATTERN.matcher(busId); if (m.find()) { busId = busId.substring(0, m.start() + Bus.DEFAULT_BUS_ID.length()); } } return endpoint.getEndpointInfo().getService().getName() + "." + endpoint.getEndpointInfo().getName() + "@" + busId; }
public static CacheManager getCacheManager(Bus bus, URL configFileURL) { CacheManager cacheManager = null; String globalCacheManagerName = getGlobalCacheManagerName(bus); if (globalCacheManagerName != null) { cacheManager = CacheManager.getCacheManager(globalCacheManagerName); } if (cacheManager == null) { String confName = ""; if (bus != null) { confName = bus.getId(); } cacheManager = EHCacheManagerHolder.getCacheManager(confName, configFileURL); } return cacheManager; }
@Test public void testManagedBusWithTransientId() throws Exception { SpringBusFactory factory = new SpringBusFactory(); Bus bus = factory.createBus("org/apache/cxf/systest/management/managed-bus.xml", true); doManagedBusTest(bus, bus.getId(), "cxf_managed_bus_test", Integer.parseInt(JMX_PORT1)); }
@Test public void testManagedBusWithPersistentId() throws Exception { SpringBusFactory factory = new SpringBusFactory(); Bus bus = factory.createBus("org/apache/cxf/systest/management/persistent-id.xml", true); doManagedBusTest(bus, "cxf_managed_bus_test", bus.getId(), Integer.parseInt(JMX_PORT2)); }