Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mule.umo.impl
Class ProviderList  view ProviderList download ProviderList.java

java.lang.Object
  extended byorg.mule.umo.impl.ProviderList

public class ProviderList
extends java.lang.Object

ProviderList encapsulates two lists of ProviderDescriptors; send providers and receive providers. It also provides helper methods to query manipulate and maintain state of the lists.

Version:
$Revision: 1.7 $

Field Summary
private  java.lang.String defaultReceive
          The name of the default receive provider
private  java.lang.String defaultSend
          The name of the default send provider
private static org.apache.commons.logging.Log log
          logger used by this class
private  java.util.Map receiveProviders
          A map of receive providers
private  java.util.Map sendProviders
          A map of send providers
 
Constructor Summary
ProviderList()
          Default constructor
ProviderList(java.util.Map providers)
          Creates a provider list based on a map of providers where the key is the provider name
 
Method Summary
 void add(MuleProviderDescriptor provider)
          Add a provider to the list
 void add(MuleProviderDescriptor provider, boolean readOnly)
          Add a provider to the list
protected  void addReceiveProvider(MuleProviderDescriptor provider)
          Adds a receive provider to the list
protected  void addReceiveProvider(MuleProviderDescriptor provider, boolean readOnly)
          Adds a receive provider to the list
protected  void addSendProvider(MuleProviderDescriptor provider)
          Adds a send provider to the list
 void addSendProvider(MuleProviderDescriptor provider, boolean readOnly)
          Adds a send provider to the list
 org.mule.umo.UMOProviderDescriptor get(java.lang.String name)
          Returns a provider with the given name
 MuleProviderDescriptor getDefaultReceiveProvider()
          Returns the default Receive Provider in the list.
 MuleProviderDescriptor getDefaultSendProvider()
          Returns the default Send Provider in the list.
private  MuleProviderDescriptor[] getProvidersByProtocol(java.util.Map providers, java.lang.String protocol)
          Returns a list of all providers that use the given protocol
 MuleProviderDescriptor getReceiveProvider(java.lang.String name)
          Retrieves a receive provider with the given name
 org.mule.umo.UMOProviderDescriptor[] getReceiveProvidersByProtocol(java.lang.String protocol)
          Returns a list of receive providers that use the given protocol
 int getReceiveProvidersSize()
          Returns the total number of receive providers
 java.util.Iterator getReceiverNames()
          Returns an Iterator of receive provider names in the provider list
 java.util.Iterator getSenderNames()
          Returns an Iterator of send provider names in the provider list
 MuleProviderDescriptor getSendProvider(java.lang.String name)
          Retrieves a send provider with the given name
 MuleProviderDescriptor[] getSendProvidersByProtocol(java.lang.String protocol)
          Returns a list of send providers that use the given protocol
 int getSendProvidersSize()
          Returns the total number of send providers
 int getTotalSize()
          Gets the total number of all providers in the list
 void remove(org.mule.umo.UMOProviderDescriptor provider)
          Removes a provider from the list
 void setDefaultReceiveProvider(MuleProviderDescriptor provider)
          Sets the specified provider to be the default in the list
 void setDefaultReceiveProvider(MuleProviderDescriptor provider, boolean readOnly)
          Sets the specified provider to be the default in the list
 void setDefaultSendProvider(MuleProviderDescriptor provider)
          Sets the specified provider to be the default in the list
 void setDefaultSendProvider(MuleProviderDescriptor provider, boolean readOnly)
          Sets the specified provider to be the default in the list
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

private static transient org.apache.commons.logging.Log log
logger used by this class


sendProviders

private java.util.Map sendProviders
A map of send providers


receiveProviders

private java.util.Map receiveProviders
A map of receive providers


defaultSend

private java.lang.String defaultSend
The name of the default send provider


defaultReceive

private java.lang.String defaultReceive
The name of the default receive provider

Constructor Detail

ProviderList

public ProviderList()
Default constructor


ProviderList

public ProviderList(java.util.Map providers)
Creates a provider list based on a map of providers where the key is the provider name

Method Detail

getReceiverNames

public java.util.Iterator getReceiverNames()
Returns an Iterator of receive provider names in the provider list


getSenderNames

public java.util.Iterator getSenderNames()
Returns an Iterator of send provider names in the provider list


getReceiveProvider

public MuleProviderDescriptor getReceiveProvider(java.lang.String name)
Retrieves a receive provider with the given name


getSendProvider

public MuleProviderDescriptor getSendProvider(java.lang.String name)
Retrieves a send provider with the given name


addSendProvider

protected void addSendProvider(MuleProviderDescriptor provider)
Adds a send provider to the list


addSendProvider

public void addSendProvider(MuleProviderDescriptor provider,
                            boolean readOnly)
Adds a send provider to the list


addReceiveProvider

protected void addReceiveProvider(MuleProviderDescriptor provider)
Adds a receive provider to the list


addReceiveProvider

protected void addReceiveProvider(MuleProviderDescriptor provider,
                                  boolean readOnly)
Adds a receive provider to the list


setDefaultSendProvider

public void setDefaultSendProvider(MuleProviderDescriptor provider)
                            throws org.mule.MuleException
Sets the specified provider to be the default in the list


setDefaultSendProvider

public void setDefaultSendProvider(MuleProviderDescriptor provider,
                                   boolean readOnly)
                            throws org.mule.MuleException
Sets the specified provider to be the default in the list


setDefaultReceiveProvider

public void setDefaultReceiveProvider(MuleProviderDescriptor provider)
                               throws org.mule.MuleException
Sets the specified provider to be the default in the list


setDefaultReceiveProvider

public void setDefaultReceiveProvider(MuleProviderDescriptor provider,
                                      boolean readOnly)
                               throws org.mule.MuleException
Sets the specified provider to be the default in the list


getDefaultReceiveProvider

public MuleProviderDescriptor getDefaultReceiveProvider()
Returns the default Receive Provider in the list. If no default has been specified, the first receive provider added will be used


getDefaultSendProvider

public MuleProviderDescriptor getDefaultSendProvider()
Returns the default Send Provider in the list. If no default has been specified, the first send provider added will be used


getSendProvidersSize

public int getSendProvidersSize()
Returns the total number of send providers


getReceiveProvidersSize

public int getReceiveProvidersSize()
Returns the total number of receive providers


add

public void add(MuleProviderDescriptor provider)
Add a provider to the list


add

public void add(MuleProviderDescriptor provider,
                boolean readOnly)
Add a provider to the list


get

public org.mule.umo.UMOProviderDescriptor get(java.lang.String name)
Returns a provider with the given name


remove

public void remove(org.mule.umo.UMOProviderDescriptor provider)
Removes a provider from the list


getTotalSize

public int getTotalSize()
Gets the total number of all providers in the list


getReceiveProvidersByProtocol

public org.mule.umo.UMOProviderDescriptor[] getReceiveProvidersByProtocol(java.lang.String protocol)
Returns a list of receive providers that use the given protocol


getSendProvidersByProtocol

public MuleProviderDescriptor[] getSendProvidersByProtocol(java.lang.String protocol)
Returns a list of send providers that use the given protocol


getProvidersByProtocol

private MuleProviderDescriptor[] getProvidersByProtocol(java.util.Map providers,
                                                        java.lang.String protocol)
Returns a list of all providers that use the given protocol


toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).