コード例 #1
0
ファイル: MonitorFilter.java プロジェクト: Rikatouka/net.jxta
  /** {@inheritDoc} */
  public void initializeFrom(Element element) throws DocumentSerializationException {
    for (Enumeration e = element.getChildren(); e.hasMoreElements(); ) {
      Element serviceElement = (TextElement) e.nextElement();
      String tagName = (String) serviceElement.getKey();

      if (tagName.equals("service")) {
        try {
          ModuleClassID moduleClassID =
              (ModuleClassID)
                  IDFactory.fromURI(
                      new URI(
                          DocumentSerializableUtilities.getString(
                              serviceElement, "moduleClassID", "ERROR")));

          try {
            ServiceMonitorFilter serviceMonitorFilter =
                MonitorResources.createServiceMonitorFilter(moduleClassID);
            serviceMonitorFilter.init(moduleClassID);
            Element serviceMonitorFilterElement =
                DocumentSerializableUtilities.getChildElement(serviceElement, "serviceFilter");
            serviceMonitorFilter.initializeFrom(serviceMonitorFilterElement);
            serviceMonitorFilters.put(moduleClassID, serviceMonitorFilter);
          } catch (Exception ex) {
            if (unknownModuleClassIDs == null) unknownModuleClassIDs = new LinkedList();

            unknownModuleClassIDs.add(moduleClassID);
          }
        } catch (URISyntaxException jex) {
          throw new DocumentSerializationException("Can't get ModuleClassID", jex);
        }
      }
    }
  }
コード例 #2
0
ファイル: SSLGenericServer.java プロジェクト: cschneider/ecf
 private static SSLServerSOContainer createServerContainer(
     String id, SSLServerSOContainerGroup group, String path, int keepAlive)
     throws IDCreateException {
   System.out.println(
       "  Creating container with id="
           + id
           + " keepAlive="
           + keepAlive); //$NON-NLS-1$ //$NON-NLS-2$
   final ID newServerID = IDFactory.getDefault().createStringID(id);
   final SOContainerConfig config = new SOContainerConfig(newServerID);
   return new SSLServerSOContainer(config, group, path, keepAlive);
 }
コード例 #3
0
  /** {@inheritDoc} */
  public void initializeFrom(Element element) throws DocumentSerializationException {
    for (Enumeration e = element.getChildren(); e.hasMoreElements(); ) {
      Element childElement = (TextElement) e.nextElement();
      String tagName = (String) childElement.getKey();

      if (tagName.equals("transportMetric")) {
        TransportMetric transportMetric =
            (TransportMetric)
                DocumentSerializableUtilities.getDocumentSerializable(
                    childElement, TransportMetric.class);
        transportMetrics.add(transportMetric);
      }
      if (tagName.equals("moduleClassID")) {
        try {
          moduleClassID =
              (ModuleClassID)
                  IDFactory.fromURI(new URI(DocumentSerializableUtilities.getString(childElement)));
        } catch (URISyntaxException jex) {
          throw new DocumentSerializationException("Can't read moduleClassID", jex);
        }
      }
    }
  }
コード例 #4
0
 public static R_OSGiID createR_OSGiID(Namespace namespace, String uriStr) {
   return (R_OSGiID) IDFactory.getDefault().createID(namespace, uriStr);
 }