org.apache.cxf.Bus.getId()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(11.0k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中org.apache.cxf.Bus.getId()方法的一些代码示例,展示了Bus.getId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bus.getId()方法的具体详情如下:
包路径:org.apache.cxf.Bus
类名称:Bus
方法名:getId

Bus.getId介绍

暂无

代码示例

代码示例来源:origin: apache/cxf

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);
}

代码示例来源:origin: apache/cxf

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());
}

代码示例来源:origin: org.apache.cxf/cxf-rt-core

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());
}

代码示例来源:origin: apache/cxf

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;
}

代码示例来源:origin: org.apache.cxf/cxf-core

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());
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

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());
}

代码示例来源:origin: apache/cxf

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());
  }
}

代码示例来源:origin: apache/cxf

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());
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-core

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);
  }
}

代码示例来源:origin: org.apache.cxf.services.sts/cxf-services-sts-core

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());
  }
}

代码示例来源:origin: apache/cxf

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());
  }
}

代码示例来源:origin: org.apache.cxf.services.sts/cxf-services-sts-core

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());
  }
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

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);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-core

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());
  }
}

代码示例来源:origin: apache/cxf

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));
  }
}

代码示例来源:origin: org.apache.cxf/cxf-core

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));
  }
}

代码示例来源:origin: apache/cxf

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;
}

代码示例来源:origin: org.apache.cxf/cxf-rt-ws-security

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;
}

代码示例来源:origin: apache/cxf

@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));
}

代码示例来源:origin: apache/cxf

@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));
}

相关文章