Examples of NotificationException


Examples of org.codehaus.plexus.notification.NotificationException

        {
            message = generateMessage( project, build );
        }
        catch ( ContinuumException e )
        {
            throw new NotificationException( "Can't generate the message.", e );
        }

        msnClient.setLogin( getUsername( configuration ) );

        msnClient.setPassword( getPassword( configuration ) );

        try
        {
            msnClient.login();

            for ( Iterator i = recipients.iterator(); i.hasNext(); )
            {
                String recipient = (String) i.next();

                msnClient.sendMessage( recipient, message );
            }
        }
        catch ( MsnException e )
        {
            throw new NotificationException( "Exception while sending message.", e );
        }
        finally
        {
            try
            {
View Full Code Here

Examples of org.servicemix.ws.notification.NotificationException

    protected InvokerSupport createDispatcher(SubscribeDocument.Subscribe subscribe) {
        try {
            ServiceEndpoint endpoint = findSubscriberEndpoint(subscribe);
            if (endpoint == null) {
                throw new NotificationException("Could not find a suitable JBI ServiceEndpoint reference for the consumerReference: " + subscribe.getConsumerReference());
            }
            JBIInvoker invoker = new JBIInvoker(context.getDeliveryChannel(), endpoint, subscribe);
            return invoker;
        }
        catch (MessagingException e) {
            throw new NotificationException(e);
        }
    }
View Full Code Here

Examples of org.servicemix.ws.notification.NotificationException

     * Extracts the subscriber endpoint from the subscription request using the serviceName or the portType
     */
    protected ServiceEndpoint findSubscriberEndpoint(SubscribeDocument.Subscribe subscribe) {
        org.servicemix.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType consumerReference = subscribe.getConsumerReference();
        if (consumerReference == null) {
            throw new NotificationException("No consumerReference specified for subscription: " + subscribe);
        }
        org.servicemix.ws.xmlbeans.addressing.v2003_03.ServiceNameType serviceNameType = consumerReference.getServiceName();
        if (serviceNameType == null) {
            log.warn("No service name available for subscription: " + subscribe);
        }
View Full Code Here

Examples of org.servicemix.ws.notification.NotificationException

        Calendar terminationTime = publisherInfo.getInitialTerminationTime();
        if (terminationTime != null) {
            // Termination time cannot be in the past
            if (terminationTime.before(Calendar.getInstance())) {
                // Is this the right way to fault??
                throw new NotificationException("Termination time cannot be in the past.");
            }           
            // We could fault here if the time is too far in the future.
        }
        else {
            // We could default a sensible timeout here.
        }
       
        // Create publisher and assoicate an EndpointReference with it.
        EndpointReferenceType registrationEndpointReference;
        try {

            ActiveMQPublisherRegistration publisher = new ActiveMQPublisherRegistration(connection);
            registrationEndpointReference = publisherManager.register(publisher);
            publisher.setEndpointReference(registrationEndpointReference);
            publisher.setTerminationTime(terminationTime);
            publisher.setDemand(publisherInfo.getDemand());

            if (publisherInfo.getDemand()) {
                publisher.setPublisherReference(publisherInfo.getPublisherReference());
            }

            publisher.setTopic(topic);
            publisher.start();

        }
        catch (JMSException e) {
            throw new NotificationException(e);
        }
       
        // Send response.
        RegisterPublisherResponseDocument responseDoc = RegisterPublisherResponseDocument.Factory.newInstance();
        RegisterPublisherResponse response = responseDoc.addNewRegisterPublisherResponse();
View Full Code Here

Examples of org.servicemix.ws.notification.NotificationException

                ActiveMQPublisherRegistration publisher = getPublisher(producerReference);
                publisher.notify(topic, messageHolder.getMessage());
            }
        }
        catch (IOException e) {
            throw new NotificationException(e);
        }
        catch (JMSException e) {
            throw new NotificationException(e);
        }
    }
View Full Code Here

Examples of org.servicemix.ws.notification.NotificationException

        Calendar terminationTime = subscribe.getInitialTerminationTime();
        if (terminationTime != null) {
            // Termination time cannot be in the past
            if (terminationTime.before(Calendar.getInstance())) {
                // Is this the right way to fault??
                throw new NotificationException("Termination time cannot be in the past.");
            }           
            // We could fault here if the time is too far in the future.
        }
        else {
            // We could default a sensible timeout here.
        }

        ActiveMQSubscription subscription;
        try {

            subscription = new ActiveMQSubscription(connection);
            subscription.setTopicExpression(subscribe.getTopicExpression());
            subscription.setConsumerReference(subscribe.getConsumerReference());
            subscription.setPrecondition(subscribe.getPrecondition());
            subscription.setSelector(subscribe.getSelector());
            subscription.setSubscriptionPolicy(subscribe.getSubscriptionPolicy());
            subscription.setTopicExpression(subscribe.getTopicExpression());
            subscription.setUseNotify(subscribe.getUseNotify());
            subscription.setDispatcher(createDispatcher(subscribe));

            subscription.start();

        }
        catch (JMSException e) {
            throw new NotificationException(e);
        }

        EndpointReferenceType endpointReference = subscriptionManager.register(subscription);
        subscription.setEndpointReference(endpointReference);
       
View Full Code Here

Examples of org.servicemix.ws.notification.NotificationException

            }
        };
    }

    public GetCurrentMessageResponseDocument getCurrentMessage(GetCurrentMessageDocument request) {
        throw new NotificationException("Not supported");
    }
View Full Code Here

Examples of org.wso2.carbon.event.broker.exceptions.NotificationException

    public void publishEvent(ConfigurationContext configurationContext, Event event) throws NotificationException {
        try {
      if (getExecutor() == null) {
          String msg = "Notification Dispatcher not initialized";
          log.error(msg);
          throw new NotificationException(msg);
      }
            if (event == null || event.getMessage() == null) {
                String msg = "Unable to Dispatch Notification. The incoming event was null, or did " +
                        "not contain a message.";
          log.error(msg);
          throw new NotificationException(msg);
            }
           
            if(event.getMessage() instanceof MessageContext){
                SOAPEnvelope envelope = ((MessageContext)event.getMessage()).getEnvelope();
                envelope.build();
                envelope.getBody().build();   
            } else if(event.getMessage() instanceof OMElement){
                ((OMElement)event.getMessage()).build();
            }
           
      SubscriptionManager subManager = broker.getSubscriptionManager();
      List<Subscription> subscriptions = subManager.getMatchingSubscriptions(event);
      for (Subscription subscription : subscriptions) {
         try {
           EventDispatcher dispatcher = subscription.getEventDispatcher();

           if (dispatcher == null){
                         for (String key : customDispatchers.keySet()) {
                             if (subscription.getFilterDesc().getFilterValue() != null &&
                                     subscription.getFilterDesc().getFilterValue().startsWith(key)) {
                                 dispatcher = customDispatchers.get(key);
                                 break;
                             }
                         }
                         if (dispatcher == null) {
                             dispatcher = new CarbonEventDispatcher();
                             if (configurationContext != null) {
                                 ((CarbonEventDispatcher) dispatcher).init(configurationContext);
                             }
                         }
           }
           getExecutor().submit(new Worker(dispatcher,  event, subscription));
           } catch (Exception e) {
             //errors should not happen here, but just in case
               log.warn("Unable to dispatch event of type " + event.getClass().getName() +
                   e.getMessage(), e);
           }
      }
    } catch (EventException e) {
            if (e instanceof NotificationException) {
                throw (NotificationException)e;
            }
      throw new NotificationException("Failed publishing the event "+ e.getMessage(),e);
    }
    }
View Full Code Here

Examples of org.wso2.carbon.event.broker.exceptions.NotificationException

        public void publishEvent(Event event) throws NotificationException {
            if (event != null) {
                eventPublished = true;
            } else {
                throw new NotificationException("no event found");
            }
        }
View Full Code Here

Examples of org.wso2.carbon.eventing.broker.exceptions.NotificationException

        @Override
        public void publishEvent(Event event) throws NotificationException {
            if (event != null) {
                eventPublished = true;
            } else {
                throw new NotificationException("no event found");
            }
        }
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.