equip.data
Class DataManager

java.lang.Object
  extended byequip.data.DataManager

public class DataManager
extends java.lang.Object

Dataspace manager, the preferred factory for dataspace clients and servers. Use this to get dataspace clients and servers; see getDataspace(equip.net.ServerURL,int,boolean,boolean,equip.data.GUID).


Nested Class Summary
 class DataManager.DataspaceInfo
          Internal class of DataManager
 
Field Summary
static int DATASPACE_CLIENT
          type for a dataspace client
static int DATASPACE_PEER
          type for a dataspace peer (not yet implemented)
static int DATASPACE_SERVER
          type for a dataspace server
 
Constructor Summary
DataManager()
          Lifecycle - don't use these - rely on the static singleton
 
Method Summary
 DataProxy getDataspace(ServerURL url, int type, boolean activateFlag)
          Find a dataspace replica in the local cache, else create and add to the cache.
 DataProxy getDataspace(ServerURL surl, int type, boolean activateFlag, boolean asyncFlag)
          Find a dataspace replica in the local cache, else create and add to the cache.
 DataProxy getDataspace(ServerURL surl, int type, boolean activateFlag, boolean asyncFlag, GUID responsible)
          Find a dataspace replica in the local cache, else create and add to the cache.
 DataProxy getDataspace(java.lang.String url, int type, boolean activateFlag)
          Find a dataspace replica in the local cache, else create and add to the cache.
 DataProxy getDataspace(java.lang.String url, int type, boolean activateFlag, boolean asyncFlag)
          Find a dataspace replica in the local cache, else create and add to the cache.
 DataProxy getDataspace(java.lang.String url, int type, boolean activateFlag, boolean asyncFlag, GUID responsible)
          Find a dataspace replica in the local cache, else create and add to the cache.
 DataManager.DataspaceInfo[] getDataspaceInfos()
          get current data proxies known
static DataManager getInstance()
          get singleton data manager (now just uses SingletonManager).
 void releaseDataspace(DataProxy dataspace)
          Complementary to getDataspace, reduces use count by one, and removes from internal table if use count falls to 0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATASPACE_CLIENT

public static final int DATASPACE_CLIENT
type for a dataspace client

See Also:
Constant Field Values

DATASPACE_SERVER

public static final int DATASPACE_SERVER
type for a dataspace server

See Also:
Constant Field Values

DATASPACE_PEER

public static final int DATASPACE_PEER
type for a dataspace peer (not yet implemented)

See Also:
Constant Field Values
Constructor Detail

DataManager

public DataManager()
Lifecycle - don't use these - rely on the static singleton

Method Detail

getInstance

public static DataManager getInstance()
get singleton data manager (now just uses SingletonManager).


getDataspace

public DataProxy getDataspace(java.lang.String url,
                              int type,
                              boolean activateFlag)
Find a dataspace replica in the local cache, else create and add to the cache. Converts the url to a ServerURL, defaults asyncFlag to false, and allocates a new random responsible ID (see getDataspace(equip.net.ServerURL,int,boolean,boolean,equip.data.GUID)).


getDataspace

public DataProxy getDataspace(java.lang.String url,
                              int type,
                              boolean activateFlag,
                              boolean asyncFlag)
Find a dataspace replica in the local cache, else create and add to the cache. Converts the url to a ServerURL, and allocates a new random responsible ID (see getDataspace(String,int,boolean,boolean,GUID)).


getDataspace

public DataProxy getDataspace(java.lang.String url,
                              int type,
                              boolean activateFlag,
                              boolean asyncFlag,
                              GUID responsible)
Find a dataspace replica in the local cache, else create and add to the cache. Converts the url to a ServerURL, (see getDataspace(String,int,boolean,boolean,GUID)).


getDataspace

public DataProxy getDataspace(ServerURL url,
                              int type,
                              boolean activateFlag)
Find a dataspace replica in the local cache, else create and add to the cache. Defaults asyncFlag to false, and allocates a new random responsible ID (see getDataspace(equip.net.ServerURL,int,boolean,boolean,equip.data.GUID)).


getDataspace

public DataProxy getDataspace(ServerURL surl,
                              int type,
                              boolean activateFlag,
                              boolean asyncFlag)
Find a dataspace replica in the local cache, else create and add to the cache. Allocates a new random responsible ID (see getDataspace(equip.net.ServerURL,int,boolean,boolean,equip.data.GUID)).


getDataspace

public DataProxy getDataspace(ServerURL surl,
                              int type,
                              boolean activateFlag,
                              boolean asyncFlag,
                              GUID responsible)
Find a dataspace replica in the local cache, else create and add to the cache.

Parameters:
type - DATASPACE_CLIENT, DATASPACE_SERVER or DATASPACE_PEER (peer is not yet implemented). (if the dataspace is not already present in the cace).
activateFlag - call {link DataProxy#activate} before returning (caller calls deactivate) (if the dataspace is not already present in the cace).
asyncFlag - if activateFlag is true, then call DataProxy.activateAsync() rather than {link DataProxy#activate} (if the dataspace is not already present in the cace).
responsible - Use this GUID as the replica ID (if the dataspace is not already present in the cace).
Returns:
A reference to a new or cached DataProxyImpl or Server dataspace replica.

releaseDataspace

public void releaseDataspace(DataProxy dataspace)
Complementary to getDataspace, reduces use count by one, and removes from internal table if use count falls to 0. Matching calls required for garbage collection to have any chance of a dataspace.


getDataspaceInfos

public DataManager.DataspaceInfo[] getDataspaceInfos()
get current data proxies known