Examples of EndpointEventListener


Examples of org.glassfish.tyrus.core.monitoring.EndpointEventListener

        } else {
            throw collector.composeComprehensiveException();
        }

        String endpointPath = config instanceof ServerEndpointConfig ? ((ServerEndpointConfig) config).getPath() : null;
        EndpointEventListener endpointEventListener = applicationEventListener.onEndpointRegistered(endpointPath, endpointClass);
        endpointEventListenerWrapper.setEndpointEventListener(endpointEventListener);
    }
View Full Code Here

Examples of org.glassfish.tyrus.core.monitoring.EndpointEventListener

                throw collector.composeComprehensiveException();
            }
        }

        register(endpointWrapper);
        EndpointEventListener endpointEventListener = applicationEventListener.onEndpointRegistered(serverConfig.getPath(), endpointClass);
        endpointEventListenerWrapper.setEndpointEventListener(endpointEventListener);
    }
View Full Code Here

Examples of org.osgi.service.remoteserviceadmin.EndpointEventListener

            logError(logMethodName, message, e);
          }
        // and EndpointEventListenerEvents
        } else if (eventObject instanceof EndpointEventListenerEvent) {
          final EndpointEventListenerEvent event = (EndpointEventListenerEvent) eventObject;
          final EndpointEventListener endpointEventListener = event.getEndpointEventListener();
          final EndpointEvent endpointEvent = event.getEndpointEvent();
          final String matchingFilter = event.getMatchingFilter();
          try {
            trace("endpointEventListener.discovered=" + getEndpointEventTypeAsString(endpointEvent.getType()) + " ", "fwk=" + getFrameworkUUID() + ", endpointEventListener=" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                    + endpointEventListener
                    + ", endpointEvent=" //$NON-NLS-1$
                    + endpointEvent + ", matchingFilter=" //$NON-NLS-1$
                    + matchingFilter);
            endpointEventListener.endpointChanged(endpointEvent,
                matchingFilter);
          } catch (Exception e) {
            String message = "Exception in EndpointEventListener listener=" //$NON-NLS-1$
                + endpointEventListener + " event=" //$NON-NLS-1$
                + endpointEvent + " matchingFilter=" //$NON-NLS-1$
                + matchingFilter;
            logError(logMethodName, message, e);
          } catch (LinkageError e) {
            String message = "LinkageError in EndpointEventListener listener=" //$NON-NLS-1$
                + endpointEventListener + " event=" //$NON-NLS-1$
                + endpointEvent + " matchingFilter=" //$NON-NLS-1$
                + matchingFilter;
            logError(logMethodName, message, e);
          } catch (AssertionError e) {
            String message = "AssertionError in EndpointEventListener listener=" //$NON-NLS-1$
                + endpointEventListener + " event=" //$NON-NLS-1$
                + endpointEvent + " matchingFilter=" //$NON-NLS-1$
                + matchingFilter;
            logError(logMethodName, message, e);
           
          }
        }
      }
    });
    // Register the endpoint listener tracker, so that endpoint listeners
    // that are subsequently added
    // will then be notified of discovered endpoints
    endpointListenerTracker = new ServiceTracker(context,
        EndpointListener.class.getName(),
        new ServiceTrackerCustomizer() {
          public Object addingService(ServiceReference reference) {
            if (context == null)
              return null;
            EndpointListener listener = (EndpointListener) context
                .getService(reference);
            if (listener == null)
              return null;
            Collection<org.osgi.service.remoteserviceadmin.EndpointDescription> allDiscoveredEndpointDescriptions = getAllDiscoveredEndpointDescriptions();
            for (org.osgi.service.remoteserviceadmin.EndpointDescription ed : allDiscoveredEndpointDescriptions) {
              EndpointDescriptionLocator.EndpointListenerHolder[] endpointListenerHolders = getMatchingEndpointListenerHolders(
                  new ServiceReference[] { reference }, ed);
              if (endpointListenerHolders != null) {
                for (int i = 0; i < endpointListenerHolders.length; i++) {
                  queueEndpointDescription(
                      endpointListenerHolders[i]
                          .getListener(),
                      endpointListenerHolders[i]
                          .getDescription(),
                      endpointListenerHolders[i]
                          .getMatchingFilter(), true);
                }
              }
            }
            return listener;
          }

          public void modifiedService(ServiceReference reference,
              Object service) {
          }

          public void removedService(ServiceReference reference,
              Object service) {
          }
        });

    endpointListenerTracker.open();

    // Register the endpoint event listener tracker, so that endpoint event listeners
    // that are subsequently added
    // will then be notified of discovered endpoints
    endpointEventListenerTracker = new ServiceTracker(context,
        EndpointEventListener.class.getName(),
        new ServiceTrackerCustomizer() {
          public Object addingService(ServiceReference reference) {
            if (context == null)
              return null;
            EndpointEventListener listener = (EndpointEventListener) context
                .getService(reference);
            if (listener == null)
              return null;
            Collection<org.osgi.service.remoteserviceadmin.EndpointDescription> allDiscoveredEndpointDescriptions = getAllDiscoveredEndpointDescriptions();
            for (org.osgi.service.remoteserviceadmin.EndpointDescription ed : allDiscoveredEndpointDescriptions) {
View Full Code Here

Examples of org.osgi.service.remoteserviceadmin.EndpointEventListener

      ServiceReference[] refs, EndpointDescription description, int type) {
    if (refs == null)
      return null;
    List results = new ArrayList();
    for (int i = 0; i < refs.length; i++) {
      EndpointEventListener listener = (EndpointEventListener) context
          .getService(refs[i]);
      if (listener == null)
        continue;
      List<String> filters = PropertiesUtil.getStringPlusProperty(
          getMapFromProperties(refs[i]),
View Full Code Here

Examples of org.osgi.service.remoteserviceadmin.EndpointEventListener

                      : message), e));
    }

    private void deliverSafe(EndpointEvent endpointEvent,
        String matchingFilter) {
      EndpointEventListener listener = Activator.this.basicTopologyManagerImpl;
      if (listener == null)
        return;
      try {
        listener.endpointChanged(endpointEvent, matchingFilter);
      } catch (Exception e) {
        String message = "Exception in EndpointEventListener listener=" //$NON-NLS-1$
            + listener + " event=" //$NON-NLS-1$
            + endpointEvent + " matchingFilter=" //$NON-NLS-1$
            + matchingFilter;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.