All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sics.agentbase.core.CentralFactory

java.lang.Object
   |
   +----sics.agentbase.core.CentralFactory

public class CentralFactory
extends Object
implements ContentHandlerFactory, URLStreamHandlerFactory

Constructor Index

 o CentralFactory()

Method Index

 o addContentHandler(String, ContentHandler)
Adds a content handler for the specified type.
 o addMessage(Message)
Delivers a message to a message listener. Deprecated.
 o addMessageListener(String, MessageListener)
Adds a message listener with the specified name. Deprecated.
 o addProtocolHandler(String, ProtocolHandler)
Adds a protocol handler for the specified protocol.
 o addURLStreamHandler(String, URLStreamHandler)
Adds a URLStreamHandler for the specified protocol.
 o createContentHandler(String)
Creates a new content handler for the specified content type.
 o createProtocolHandler(String)
Creates a new protocol handler for the specified protocol.
 o createURLStreamHandler(String)
Creates a new URLStreamHandler for the specified protocol.
 o getProperty(String)
Returns the value of the specified property. Deprecated.
 o getProtocolHandlers()
Returns an enumeration of all registered protocol handlers.
 o registerContentHandlerFactory()
Registers the CentralFactory object as the default ContentHandlerFactory. Deprecated.
 o registerURLStreamHandlerFactory()
Registers the CentralFactory object as the default URLStreamHandlerFactory. Deprecated.
 o removeContentHandler(String)
Removes the content handler for the specified type.
 o removeMessageListener(String)
Removes the message listener with the specified name. Deprecated.
 o removeProperty(String)
Removes the specified property. Deprecated.
 o removeProtocolHandler(String)
Removes the protocol handler for the specified protocol.
 o removeURLStreamHandler(String)
Removes the URLStreamHandler for the specified protocol.
 o setProperty(String, String)
Sets the specified property. Deprecated.

Constructors

 o CentralFactory
 public CentralFactory()

Methods

 o addMessageListener
 public static void addMessageListener(String name,
                                       MessageListener listener)
Note: addMessageListener() is deprecated. the preferred way to add a message listener is to use a Message Dispatcher, for example:

   MessageDispatcher.getDefaultMessageDispatcher().addMessageListener(n,l);
 

Adds a message listener with the specified name.

Parameters:
name - the name of the message listener to add.
listener - the message listener to be added.
 o removeMessageListener
 public static void removeMessageListener(String name)
Note: removeMessageListener() is deprecated. the preferred way to add a message listener is to use a Message Dispatcher, for example:

   MessageDispatcher.getDefaultMessageDispatcher().removeMessageListener(n);
 

Removes the message listener with the specified name.

Parameters:
name - the name of the message listener to remove.
 o addMessage
 public static void addMessage(Message msg)
Note: addMessage() is deprecated. the preferred way to add a message listener is to use a Message Dispatcher, for example:

   MessageDispatcher.getDefaultMessageDispatcher().deliverMessage(msg);
 

Delivers a message to a message listener. The value returned from the method getLocalReceiver in the message is used to deliver the message to a message listener with matching name.

If no message listener can be found, the method error in the message is invoked with the error RECEIVER_UNKNOWN.

Parameters:
msg - the message to be added.
See Also:
RECEIVER_UNKNOWN, getLocalReceiver, error
 o registerContentHandlerFactory
 public static void registerContentHandlerFactory()
Note: registerContentHandlerFactory() is deprecated. This method has been deprecated because the registration is done automatically at the first addition of a content handler.

Registers the CentralFactory object as the default ContentHandlerFactory.

See Also:
setContentHandlerFactory
 o addContentHandler
 public static void addContentHandler(String mimetype,
                                      ContentHandler handler)
Adds a content handler for the specified type.

Parameters:
mimetype - the content type that the content handler handles.
handler - the content handler to be added.
 o removeContentHandler
 public static void removeContentHandler(String mimetype)
Removes the content handler for the specified type.

Parameters:
mimetype - the content type for the content handler to be removed.
 o createContentHandler
 public synchronized ContentHandler createContentHandler(String mimetype)
Creates a new content handler for the specified content type. Returns null if no content handler could be found.

Parameters:
mimetype - the content type.
Returns:
a content handler for the specified content type.
 o registerURLStreamHandlerFactory
 public static void registerURLStreamHandlerFactory()
Note: registerURLStreamHandlerFactory() is deprecated. This method has been deprecated because the registration is done automatically at the first addition of a URL stream handler.

Registers the CentralFactory object as the default URLStreamHandlerFactory.

See Also:
setURLStreamHandlerFactory
 o addURLStreamHandler
 public static void addURLStreamHandler(String protocol,
                                        URLStreamHandler handler)
Adds a URLStreamHandler for the specified protocol.

Parameters:
protocol - the protocol that the URLStreamHandler handles.
handler - the URLStreamHandler to be added.
 o removeURLStreamHandler
 public static void removeURLStreamHandler(String protocol)
Removes the URLStreamHandler for the specified protocol.

Parameters:
protocol - the protocol for the URLStreamHandler to be removed.
 o createURLStreamHandler
 public synchronized URLStreamHandler createURLStreamHandler(String protocol)
Creates a new URLStreamHandler for the specified protocol. Returns null if no handler could be found.

Parameters:
protocol - the protocol for the URLStreamHandler to create.
Returns:
a URLStreamHandler for the specified protocol.
 o addProtocolHandler
 public static void addProtocolHandler(String protocol,
                                       ProtocolHandler handler)
Adds a protocol handler for the specified protocol.

Parameters:
protocol - the protocol that the ProtocolHandler handles.
handler - the protocol handler for the specified protocol.
 o removeProtocolHandler
 public static void removeProtocolHandler(String protocol)
Removes the protocol handler for the specified protocol.

Parameters:
protocol - the protocol for the protocol handler to be removed.
 o createProtocolHandler
 public static ProtocolHandler createProtocolHandler(String protocol)
Creates a new protocol handler for the specified protocol. Returns null if no handler could be found.

Parameters:
protocol - the protocol for the protocol handler to create.
Returns:
a protocol handler for the specified protocol.
 o getProtocolHandlers
 public static Enumeration getProtocolHandlers()
Returns an enumeration of all registered protocol handlers.

Returns:
an Enumeration object with all registered protocol handlers.
 o setProperty
 public static void setProperty(String name,
                                String value)
Note: setProperty() is deprecated. Do not use!

Sets the specified property.

Parameters:
name - the name of the property to set.
value - the value of the property to set.
 o removeProperty
 public static void removeProperty(String name)
Note: removeProperty() is deprecated. Do not use!

Removes the specified property.

Parameters:
name - the name of the property to remove.
 o getProperty
 public static String getProperty(String name)
Note: getProperty() is deprecated. Do not use!

Returns the value of the specified property.

Parameters:
name - the name of the property to return.
Returns:
the value of the specified property or null if no such property exists.

All Packages  Class Hierarchy  This Package  Previous  Next  Index