net.rim.device.api.io.messaging
Class DestinationFactory

java.lang.Object
  extended by net.rim.device.api.io.messaging.DestinationFactory

public class DestinationFactory
extends Object

Creates Destination objects.

Since:
BlackBerry API 6.0.0

Method Summary
static BlockingReceiverDestination createBlockingReceiverDestination(InboundDestinationConfiguration config, URI uri)
          Creates a BlockingReceiverDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified.
static BlockingReceiverDestination createBlockingReceiverDestination(InboundDestinationConfiguration config, URI uri, MessageProcessor processor)
          Creates a BlockingReceiverDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified.
static BlockingSenderDestination createBlockingSenderDestination(Context context, URI uri)
          Creates a BlockingSenderDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified.
static BlockingSenderDestination createBlockingSenderDestination(Context context, URI uri, MessageProcessor processor)
          Creates a BlockingSenderDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified.
static FireAndForgetDestination createFireAndForgetDestination(Context context, URI uri)
          Creates a FireAndForgetDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified.
static NonBlockingReceiverDestination createNonBlockingReceiverDestination(InboundDestinationConfiguration config, URI uri, MessageListener listener)
          Creates a NonBlockingReceiverDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified.
static NonBlockingReceiverDestination createNonBlockingReceiverDestination(InboundDestinationConfiguration config, URI uri, MessageProcessor processor, MessageListener listener)
          Creates a NonBlockingReceiverDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified.
static NonBlockingSenderDestination createNonBlockingSenderDestination(Context context, URI uri, MessageListener listener)
          Creates a NonBlockingSenderDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified.
static NonBlockingSenderDestination createNonBlockingSenderDestination(Context context, URI uri, MessageProcessor processor, MessageListener listener)
          Creates a NonBlockingSenderDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified.
static ReceiverDestination getReceiverDestination(URI uri)
          Returns a ReceiverDestination resource for the URL specified.
static SenderDestination getSenderDestination(String contextName, URI uri)
          Returns a Destination resource associated with this sender context for the specified URL.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Method Detail

createBlockingSenderDestination

public static BlockingSenderDestination createBlockingSenderDestination(Context context,
                                                                        URI uri)
                                                                 throws MessagingException
Creates a BlockingSenderDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified. The following forms of URLs are recognized by the library:

createBlockingSenderDestination

public static BlockingSenderDestination createBlockingSenderDestination(Context context,
                                                                        URI uri,
                                                                        MessageProcessor processor)
                                                                 throws MessagingException
Creates a BlockingSenderDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified. The following forms of URLs are recognized by the library:

Parameters:
context - A Context for the Destination.
uri - URI for this BlockingSenderDestination.
processor - MessageProcessor that will be used for processing response messages.
Returns:
BlockingSenderDestination that can be used to send messages to the specified URI.
Throws:
MessagingException - If URI is incorrectly specified.
Since:
BlackBerry API 6.0.0

createNonBlockingSenderDestination

public static NonBlockingSenderDestination createNonBlockingSenderDestination(Context context,
                                                                              URI uri,
                                                                              MessageListener listener)
                                                                       throws MessagingException
Creates a NonBlockingSenderDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified. The following forms of of URLs are recognized by the library:

Parameters:
context - A Context for the Destination.
uri - URI for this NonBlockingSenderDestination.
listener - MessageListener to receive asynchronous responses.
Returns:
NonBlockingSenderDestination that can be used to send messages to the specified URI.
Throws:
MessagingException - If the URI is incorrectly specified.
Since:
BlackBerry API 6.0.0

createNonBlockingSenderDestination

public static NonBlockingSenderDestination createNonBlockingSenderDestination(Context context,
                                                                              URI uri,
                                                                              MessageProcessor processor,
                                                                              MessageListener listener)
                                                                       throws MessagingException
Creates a NonBlockingSenderDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified. The following forms of of URLs are recognized by the library:

Parameters:
context - A Context for the Destination.
uri - URI for this NonBlockingSenderDestination.
processor - MessageProcessor that will be used for processing response messages.
listener - MessageListener to receive asynchronous responses.
Returns:
NonBlockingSenderDestination that can be used to send messages to the specified URI.
Throws:
MessagingException - If URI is incorrectly specified.
Since:
BlackBerry API 6.0.0

createFireAndForgetDestination

public static FireAndForgetDestination createFireAndForgetDestination(Context context,
                                                                      URI uri)
                                                               throws MessagingException
Creates a FireAndForgetDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified. The following forms of URLs are recognized by the library:

Parameters:
context - A Context for the Destination.
uri - URI for this FireAndForgetDestination.
Returns:
FireAndForgetDestination that can be used to send messages to the specified URI.
Throws:
MessagingException - If URI is incorrectly specified.
Since:
BlackBerry API 6.0.0

createBlockingReceiverDestination

public static BlockingReceiverDestination createBlockingReceiverDestination(InboundDestinationConfiguration config,
                                                                            URI uri)
                                                                     throws MessagingException
Creates a BlockingReceiverDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified. createBlockingReceiverDestination will receive messages by listening on the URL local://deviceAppName.

Parameters:
config - InboundDestinationConfiguration to use for listening.
uri - URI for this FireAndForgetDestination.
Returns:
BlockingReceiverDestination that can be used to receive messages at the specified URI.
Throws:
MessagingException - If URI is incorrectly specified.
Since:
BlackBerry API 6.0.0

createBlockingReceiverDestination

public static BlockingReceiverDestination createBlockingReceiverDestination(InboundDestinationConfiguration config,
                                                                            URI uri,
                                                                            MessageProcessor processor)
                                                                     throws MessagingException
Creates a BlockingReceiverDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified. createBlockingReceiverDestination will receive messages by listening on the URL local://deviceAppName.

Parameters:
config - InboundDestinationConfiguration to use for listening.
uri - URI for this BlockingReceiverDestination.
processor - MessageProcessor that will be used for processing incoming messages.
Returns:
BlockingReceiverDestination that can be used to receive messages at the specified URI.
Throws:
MessagingException - If URI is incorrectly specified.
Since:
BlackBerry API 6.0.0

createNonBlockingReceiverDestination

public static NonBlockingReceiverDestination createNonBlockingReceiverDestination(InboundDestinationConfiguration config,
                                                                                  URI uri,
                                                                                  MessageListener listener)
                                                                           throws MessagingException
Creates a NonBlockingReceiverDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified. createNonBlockingReceiverDestination will receive messages by listening on the URL local://deviceAppName.

Parameters:
config - InboundDestinationConfiguration to use for listening.
uri - URI for this NonBlockingReceiverDestination.
listener - MessageListener to use for asynchronous receiving of messages.
Returns:
NonBlockingReceiverDestination that can be used to receive messages at the specified URI.
Throws:
MessagingException - If URI is incorrectly specified.
Since:
BlackBerry API 6.0.0

createNonBlockingReceiverDestination

public static NonBlockingReceiverDestination createNonBlockingReceiverDestination(InboundDestinationConfiguration config,
                                                                                  URI uri,
                                                                                  MessageProcessor processor,
                                                                                  MessageListener listener)
                                                                           throws MessagingException
Creates a NonBlockingReceiverDestination that uses a ConnectionFactory or CredentialsCollector provided by the context specified. createNonBlockingReceiverDestination will receive messages by listening on the URL local://deviceAppName.

Parameters:
config - InboundDestinationConfiguration to use for listening.
uri - URI for this NonBlockingReceiverDestination.
processor - MessageProcessor that will be used for processing incoming messages.
listener - MessageListener to use for asynchronous receiving of messages.
Returns:
NonBlockingReceiverDestination that can be used to receive messages at the specified URI.
Throws:
MessagingException - If URI is incorrectly specified.
Since:
BlackBerry API 6.0.0

getSenderDestination

public static SenderDestination getSenderDestination(String contextName,
                                                     URI uri)
Returns a Destination resource associated with this sender context for the specified URL.

Parameters:
uri - URI to get the Destination.
Returns:
A Destination that should be cast to the corresponding type (e.g. NonBlockingReceiverDestination, BlockingSenderDestination, etc.), or null if not found.
Since:
BlackBerry API 6.0.0

getReceiverDestination

public static ReceiverDestination getReceiverDestination(URI uri)
Returns a ReceiverDestination resource for the URL specified.

Parameters:
uri - URI to get the Destination for.
Returns:
A Destination that should be cast to the corresponding type (e.g. NonblockingReceiverDestination, BlockingSenderDestination, etc.), or null if not found.
Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.