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
-
CentralFactory()
-
-
addContentHandler(String, ContentHandler)
- Adds a content handler for the specified type.
-
addMessage(Message)
- Delivers a message to a message listener.
Deprecated.
-
addMessageListener(String, MessageListener)
- Adds a message listener with the specified name.
Deprecated.
-
addProtocolHandler(String, ProtocolHandler)
- Adds a protocol handler for the specified protocol.
-
addURLStreamHandler(String, URLStreamHandler)
- Adds a URLStreamHandler for the specified protocol.
-
createContentHandler(String)
- Creates a new content handler for the specified content type.
-
createProtocolHandler(String)
- Creates a new protocol handler for the specified protocol.
-
createURLStreamHandler(String)
- Creates a new URLStreamHandler for the specified protocol.
-
getProperty(String)
- Returns the value of the specified property.
Deprecated.
-
getProtocolHandlers()
- Returns an enumeration of all registered protocol handlers.
-
registerContentHandlerFactory()
- Registers the CentralFactory object as the default ContentHandlerFactory.
Deprecated.
-
registerURLStreamHandlerFactory()
- Registers the CentralFactory object as the default
URLStreamHandlerFactory.
Deprecated.
-
removeContentHandler(String)
- Removes the content handler for the specified type.
-
removeMessageListener(String)
- Removes the message listener with the specified name.
Deprecated.
-
removeProperty(String)
- Removes the specified property.
Deprecated.
-
removeProtocolHandler(String)
- Removes the protocol handler for the specified protocol.
-
removeURLStreamHandler(String)
- Removes the URLStreamHandler for the specified protocol.
-
setProperty(String, String)
- Sets the specified property.
Deprecated.
CentralFactory
public CentralFactory()
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.
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.
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
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
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.
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.
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.
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
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.
removeURLStreamHandler
public static void removeURLStreamHandler(String protocol)
- Removes the URLStreamHandler for the specified protocol.
- Parameters:
- protocol - the protocol for the URLStreamHandler to be removed.
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.
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.
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.
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.
getProtocolHandlers
public static Enumeration getProtocolHandlers()
- Returns an enumeration of all registered protocol handlers.
- Returns:
- an Enumeration object with all registered protocol handlers.
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.
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.
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