org.osgi.service.event.Event.validateTopicName()方法的使用及代码示例

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

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

Event.validateTopicName介绍

[英]Called by the constructor to validate the topic name.
[中]由构造函数调用以验证主题名称。

代码示例

代码示例来源:origin: org.osgi/org.osgi.compendium

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be ignored.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 */
public Event(String topic, Dictionary<String, ?> properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = new EventProperties(properties);
}

代码示例来源:origin: org.osgi/org.osgi.compendium

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be ignored.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 * @since 1.2
 */
public Event(String topic, Map<String, ?> properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = (properties instanceof EventProperties) ? (EventProperties) properties : new EventProperties(properties);
}

代码示例来源:origin: org.apache.felix/org.osgi.compendium

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be <code>null</code>). A
 *        property whose key is not of type <code>String</code> will be
 *        ignored.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 * @since 1.2
 */
public Event(String topic, Map/* <String,Object> */properties) {
  validateTopicName(topic);
  this.topic = topic;
  int size = (properties == null) ? 1 : (properties.size() + 1);
  Map p = new HashMap(size);
  if (properties != null) {
    for (Iterator iter = properties.keySet().iterator(); iter.hasNext();) {
      Object key = iter.next();
      if (key instanceof String) {
        Object value = properties.get(key);
        p.put(key, value);
      }
    }
  }
  p.put(EventConstants.EVENT_TOPIC, topic);
  this.properties = p; // safely publish the map
}

代码示例来源:origin: org.apache.felix/org.osgi.compendium

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be <code>null</code>). A
 *        property whose key is not of type <code>String</code> will be
 *        ignored.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 */
public Event(String topic, Dictionary/* <String,Object> */properties) {
  validateTopicName(topic);
  this.topic = topic;
  int size = (properties == null) ? 1 : (properties.size() + 1);
  Map p = new HashMap(size);
  if (properties != null) {
    for (Enumeration e = properties.keys(); e.hasMoreElements();) {
      Object key = e.nextElement();
      if (key instanceof String) {
        Object value = properties.get(key);
        p.put(key, value);
      }
    }
  }
  p.put(EventConstants.EVENT_TOPIC, topic);
  this.properties = p; // safely publish the map
}

代码示例来源:origin: org.osgi/osgi.cmpn

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be ignored.
 *        A copy of the specified properties is made.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 */
public Event(String topic, Dictionary<String, ?> properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = new EventProperties(properties);
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.osgi.services

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be ignored.
 *        A copy of the specified properties is made.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 */
public Event(String topic, Dictionary<String, ?> properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = new EventProperties(properties);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be ignored.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 */
public Event(String topic, Dictionary<String, ?> properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = new EventProperties(properties);
}

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be ignored.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 */
public Event(String topic, Dictionary<String, ?> properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = new EventProperties(properties);
}

代码示例来源:origin: org.osgi/osgi.enterprise

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be ignored.
 *        A copy of the specified properties is made.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 */
public Event(String topic, Dictionary<String, ?> properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = new EventProperties(properties);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be
 *        ignored.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 */
public Event(String topic, Dictionary<String, ? > properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = new EventProperties(properties);
}

代码示例来源:origin: org.osgi/org.osgi.enterprise

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be ignored.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 */
public Event(String topic, Dictionary<String, ?> properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = new EventProperties(properties);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be ignored.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 * @since 1.2
 */
public Event(String topic, Map<String, ?> properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = (properties instanceof EventProperties) ? (EventProperties) properties : new EventProperties(properties);
}

代码示例来源:origin: org.osgi/org.osgi.enterprise

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be ignored.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 * @since 1.2
 */
public Event(String topic, Map<String, ?> properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = (properties instanceof EventProperties) ? (EventProperties) properties : new EventProperties(properties);
}

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

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be
 *        ignored.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 */
public Event(String topic, Dictionary<String, ? > properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = new EventProperties(properties);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.osgi.services

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be ignored.
 *        A copy of the specified properties is made.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 */
public Event(String topic, Dictionary<String, ?> properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = new EventProperties(properties);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be
 *        ignored.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 */
public Event(String topic, Dictionary<String, ? > properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = new EventProperties(properties);
}

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be ignored.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 * @since 1.2
 */
public Event(String topic, Map<String, ?> properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = (properties instanceof EventProperties) ? (EventProperties) properties : new EventProperties(properties);
}

代码示例来源:origin: org.osgi/osgi.enterprise

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be ignored.
 *        If the specified properties is an {@link EventProperties} object,
 *        then it will be directly used. Otherwise, a copy of the specified
 *        properties is made.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 * @since 1.2
 */
public Event(String topic, Map<String, ?> properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = (properties instanceof EventProperties) ? (EventProperties) properties : new EventProperties(properties);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be
 *        ignored.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 * @since 1.2
 */
public Event(String topic, Map<String, ? > properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = (properties instanceof EventProperties) ? (EventProperties) properties
      : new EventProperties(properties);
}

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

/**
 * Constructs an event.
 * 
 * @param topic The topic of the event.
 * @param properties The event's properties (may be {@code null}). A
 *        property whose key is not of type {@code String} will be
 *        ignored.
 * @throws IllegalArgumentException If topic is not a valid topic name.
 * @since 1.2
 */
public Event(String topic, Map<String, ? > properties) {
  validateTopicName(topic);
  this.topic = topic;
  // safely publish the event properties
  this.properties = (properties instanceof EventProperties) ? (EventProperties) properties
      : new EventProperties(properties);
}

相关文章