portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jf...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/services Messenger.java
Date Fri, 23 Jul 2004 00:28:39 GMT
jford       2004/07/22 17:28:39

  Added:       src/java/org/apache/jetspeed/services Messenger.java
  Log:
  MessagingService implemenation
  
  Revision  Changes    Path
  1.1                  jakarta-jetspeed/src/java/org/apache/jetspeed/services/Messenger.java
  
  Index: Messenger.java
  ===================================================================
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.jetspeed.services;
  
  import javax.jms.Message;
  import javax.jms.MessageConsumer;
  import javax.jms.MessageListener;
  
  import org.apache.jetspeed.services.messaging.MessagingService;
  import org.apache.turbine.services.TurbineServices;
  
  /**
   * @author <a href="mailto:jford@apache.org">Jeremy Ford</a>
   * @version $Id: Messenger.java,v 1.1 2004/07/23 00:28:39 jford Exp $
   */
  public abstract class Messenger
  {
      /**
       * Commodity method for getting a reference to the service
       * singleton
       */
      private static MessagingService getService()
      {
          return (MessagingService)TurbineServices
                  .getInstance()
                  .getService(MessagingService.SERVICE_NAME);
      }
      
      public static void addMessageListener(MessageListener listener, String id, String destination)
      {
          getService().addMessageListener(listener, id, destination);
      }
      
      public static MessageConsumer createConsumer(String destination)
      {
          return getService().createConsumer(destination);
      }
      
      public static void removeMessageListener(String id)
      {
          getService().removeMessageListener(id);
      }
      
      public static void sendMessage(Message message, String destination)
      {
          getService().sendMessage(message, destination);
      }
      
      public static Message createMessage(int messageType)
      {
          return getService().createMessage(messageType);
      }
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message