com.netscape.pm.model
Interface IConnector


public interface IConnector

Defines an object that will act as a container for user-defined resources. This object is essentially a hashtable with some idiot-proofing added to prevent java.lang.NullPointerExceptions from being thrown in the event that one of the parameters is null.

The connector object is typically used for retrieving reuseable resources that are used throughout the life of the process, for example database connection objects. The objects are contained in a static hashtable that is accessible by all threads running on the same KJS (JVM). This implies that some type of synchronization or resource locking is required for proper behavior when deployed in a multi-threaded concurrent environment. Another consequence is that objects bound via put on one KJS will not be accessible from another KJS.

Each application has its own connector container, thus sharing objects across different deployed applications is not possible.

The object that implements IConnector is part of the application's process definition; a handle to the connector can be obtained via the IProcessDefinition interface.

See Also:
Hashtable, IProcessDefinition

Method Summary
 java.lang.Object get(java.lang.Object key)
          Returns the value object that is associated with the given key.
 java.lang.Object get(java.lang.String key)
          Returns the value object that is associated with the given key.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Associates the given key object with the given value in this connector object.
 java.lang.Object put(java.lang.String key, java.lang.Object value)
          Associates the given key string with the given value in this connector object.
 

Method Detail

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Associates the given key object with the given value in this connector object. If either the key or value are null, there will be no effect to the current contents of the connector.
Parameters:
key - a key object
value - a value object; this object may be anything that your scripts can use
Since:
PM 6.0
See Also:
Hashtable.put(java.lang.Object, java.lang.Object)

put

public java.lang.Object put(java.lang.String key,
                            java.lang.Object value)
Associates the given key string with the given value in this connector object. If either the key or value are null, there will be no effect to the current contents of the connector.
Parameters:
key - a key string
value - a value object; this object may be anything that your scripts can use
Since:
PM 6.0
See Also:
Hashtable.put(java.lang.Object, java.lang.Object)

get

public java.lang.Object get(java.lang.Object key)
Returns the value object that is associated with the given key. If the key is null, there will be no effect to the current contents of the connector; null will be returned in this case.
Parameters:
key - a key object
Returns:
the value that corresponds to this key, or null if the key is not associated with any value.
Since:
PM 6.0
See Also:
Hashtable.get(java.lang.Object)

get

public java.lang.Object get(java.lang.String key)
Returns the value object that is associated with the given key. If the key is null, there will be no effect to the current contents of the connector; null will be returned in this case.
Parameters:
key - a key string
Returns:
the value that corresponds to this key string, or null if the key is not associated with any value.
Since:
PM 6.0
See Also:
Hashtable.get(java.lang.Object)