1. /*
  2. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. package javax.jms;
  6. /** A <CODE>Topic</CODE> object encapsulates a provider-specific topic name.
  7. * It is the way a client specifies the identity of a topic to JMS API methods.
  8. *
  9. * <P>Many publish/subscribe (pub/sub) providers group topics into hierarchies
  10. * and provide various options for subscribing to parts of the hierarchy. The
  11. * JMS API places no restriction on what a <CODE>Topic</CODE> object
  12. * represents. It may be a leaf in a topic hierarchy, or it may be a larger
  13. * part of the hierarchy.
  14. *
  15. * <P>The organization of topics and the granularity of subscriptions to
  16. * them is an important part of a pub/sub application's architecture. The JMS
  17. * API
  18. * does not specify a policy for how this should be done. If an application
  19. * takes advantage of a provider-specific topic-grouping mechanism, it
  20. * should document this. If the application is installed using a different
  21. * provider, it is the job of the administrator to construct an equivalent
  22. * topic architecture and create equivalent <CODE>Topic</CODE> objects.
  23. *
  24. * @version 1.0 - 13 March 1998
  25. * @author Mark Hapner
  26. * @author Rich Burridge
  27. *
  28. * @see javax.jms.TopicSession#createTopic(String)
  29. */
  30. public interface Topic extends Destination {
  31. /** Gets the name of this topic.
  32. *
  33. * <P>Clients that depend upon the name are not portable.
  34. *
  35. * @return the topic name
  36. *
  37. * @exception JMSException if the JMS provider implementation of
  38. * <CODE>Topic</CODE> fails to return the topic
  39. * name due to some internal
  40. * error.
  41. */
  42. String
  43. getTopicName() throws JMSException;
  44. /** Returns a string representation of this object.
  45. *
  46. * @return the provider-specific identity values for this topic
  47. */
  48. String
  49. toString();
  50. }