Package hec.clientapp.model
Class ManagerProxy
java.lang.Object
hec.clientapp.model.ManagerProxy
- All Implemented Interfaces:
Serializable
Container for a Manager so that the application can see what Manager's are
out there without having to load all the Manager's data.
Manager is held by a WeakReference
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringthe class name of the Managerprotected IdentifierIdentifier specifing where the Manager's file residesprotected intThe unique index of this ManagerProxy/Managerprotected longTime Manager was last modified.protected WeakReferencereference to the Managerprotected ManagerProxyListthis ManagerProxy's ProxyListprotected mil.army.usace.hec.rmi.server.RemoteWrapperThe remote Workspaceprotected int -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new ManagerProxy objectManagerProxy(ManagerProxy proxy) Create a new ManagerProxy objectCreate a new ManagerProxy objectManagerProxy(String className, Identifier id) Create a new ManagerProxy object -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcalled by the RmiWorkspace when the manager is being deleted.booleandrop the Reference to the ManagerProxy's Managerbooleanequals(ManagerProxy that) see if the ManagerProxy equals that.booleansee if the ManagerProxy equals thatGets the Class Name of the ManagerGets the Description of the ManagerProxy objectgetId()Gets the Identifier of the ManagerProxy objectintgetIndex()Gets the Index of the ManagerProxy objectlongreturn the last modified time, if the manager is instanciated then return it's modified time.Gets the Manager of the ManagerProxy object.getName()Gets the Name of the ManagerProxy objectintgetPath()Gets the Path of the ManagerProxy objectGets the ManagerProxyList of the ManagerProxy objectlongcalled from the rmi workspace to get the Manager's last modified timegetRun()mil.army.usace.hec.rmi.server.RemoteWrapperGets the Workspace of the ManagerProxy objectbooleaninthashCode()return the hashcode for the ManagerProxyloadManager(String classname, Identifier id) load the Manager.voidrename the Manager held by this ManagerProxy.booleanrepresents(String className) see if the ManagerProxy's Manager is the same class as classNamebooleansaveAsManager(Manager newManager, Identifier id) save this Manager to a new location/namebooleanSave the Manager.booleansaveManager(Manager newManager, Identifier id) Save the ManagervoidsetClassName(String className) Sets the Manager's Class Name of the ManagerProxy objectvoidsetId(Identifier id) Sets the Identifier of the ManagerProxy objectvoidsetIndex(int idx) Sets the Index of the ManagerProxy objectvoidsetLastModifiedTime(long lastModifiedTime) Sets the LastModifiedTime of the ManagerProxy objectvoidSets the Manager of the ManagerProxy objectvoidSets the ManagerProxyList of the ManagerProxy objectvoidvoidsetWorkspace(mil.army.usace.hec.rmi.server.RemoteWrapper wkspWrap) Sets the Workspace of the ManagerProxy objecttoString()return the String representation of this ManagerProxylvoidunload the Manager from Memoryvoidwrite(BufferedWriter out) write this manager proxy out to the file
-
Field Details
-
_className
the class name of the Manager -
_managerRef
reference to the Manager -
_id
Identifier specifing where the Manager's file resides -
_Workspace
protected mil.army.usace.hec.rmi.server.RemoteWrapper _WorkspaceThe remote Workspace -
_proxyList
this ManagerProxy's ProxyList -
observerCount
protected transient int observerCount -
_lastModifiedTime
protected long _lastModifiedTimeTime Manager was last modified. -
_index
protected int _indexThe unique index of this ManagerProxy/Manager
-
-
Constructor Details
-
ManagerProxy
public ManagerProxy()Create a new ManagerProxy object -
ManagerProxy
Create a new ManagerProxy object- Parameters:
id- The Identifier to use
-
ManagerProxy
Create a new ManagerProxy object- Parameters:
className- the class name of the Managerid- the Identifier to use
-
ManagerProxy
Create a new ManagerProxy object- Parameters:
proxy- the ManagerProxy to copy from
-
-
Method Details
-
setIndex
public void setIndex(int idx) Sets the Index of the ManagerProxy object- Parameters:
idx- The new Index value
-
getIndex
public int getIndex()Gets the Index of the ManagerProxy object- Returns:
- The Index value
-
setClassName
Sets the Manager's Class Name of the ManagerProxy object- Parameters:
className- The new Class Name value
-
getClassName
Gets the Class Name of the Manager- Returns:
- The ClassName value
-
setWorkspace
public void setWorkspace(mil.army.usace.hec.rmi.server.RemoteWrapper wkspWrap) Sets the Workspace of the ManagerProxy object- Parameters:
wkspWrap- The new Workspace value
-
getWorkspace
public mil.army.usace.hec.rmi.server.RemoteWrapper getWorkspace()Gets the Workspace of the ManagerProxy object- Returns:
- The Workspace value
-
setProxyList
Sets the ManagerProxyList of the ManagerProxy object- Parameters:
pl- The new ProxyList value
-
getProxyList
Gets the ManagerProxyList of the ManagerProxy object- Returns:
- The ProxyList value
-
getId
Gets the Identifier of the ManagerProxy object- Returns:
- The Identifier
-
setId
Sets the Identifier of the ManagerProxy object- Parameters:
id- The new Identifier value
-
getRun
- Returns:
- The Run value
-
getName
Gets the Name of the ManagerProxy object- Returns:
- The Name value
-
getDescription
Gets the Description of the ManagerProxy object- Returns:
- The Description value
-
getPath
Gets the Path of the ManagerProxy object- Returns:
- The Path value
-
getManager
Gets the Manager of the ManagerProxy object. if the Manager isn't already loaded this method won't load it. Normally loadManager() should be used- Returns:
- The Manager value
-
loadManager
load the Manager. If the Manager is already loaded then just return it.- Parameters:
classname- the class name of the Manager. Normally nullid- the Identifier of the Manager's file. Normally null- Returns:
- The Manager held by this ManagerProxy
-
deleteManager
public void deleteManager()called by the RmiWorkspace when the manager is being deleted. -
renameManager
rename the Manager held by this ManagerProxy. If the Manager is loaded then it'srenamed(Identifier)method is called- Parameters:
id- the Identifier to rename the Manager to
-
dropManager
public boolean dropManager()drop the Reference to the ManagerProxy's Manager- Returns:
- true.
-
setManager
Sets the Manager of the ManagerProxy object- Parameters:
m- The new Manager
-
unloadManager
public void unloadManager()unload the Manager from Memory -
closeWorkspace
public void closeWorkspace() -
saveManager
public boolean saveManager()Save the Manager. If the Manager isn't loaded then do nothing- Returns:
- true if the Manager was successfully loaded
-
saveManager
Save the Manager- Parameters:
newManager- the Manager to Save. Normally nullid- the Identifier to save to. Normally null- Returns:
- true if the Manager is saved successfully
-
saveAsManager
save this Manager to a new location/name- Parameters:
newManager- the new Managerid- the new Identifier- Returns:
- true if the save was successful
-
represents
see if the ManagerProxy's Manager is the same class as className- Parameters:
className- the class name- Returns:
- true if the Manager's class is the same type as classname
-
setLastModifiedTime
public void setLastModifiedTime(long lastModifiedTime) Sets the LastModifiedTime of the ManagerProxy object- Parameters:
lastModifiedTime- The new LastModifiedTime value
-
getLastModifiedTime
public long getLastModifiedTime()return the last modified time, if the manager is instanciated then return it's modified time. Otherwise ask the rmi workspace to get the modified time from it's manangerProxy.- Returns:
- The LastModifiedTime value
-
getRmiLastModifiedTime
public long getRmiLastModifiedTime()called from the rmi workspace to get the Manager's last modified time- Returns:
- The LastModifiedTime value
-
write
write this manager proxy out to the file- Parameters:
out- Description- Throws:
IOException- Description
-
toString
return the String representation of this ManagerProxyl -
equals
see if the ManagerProxy equals that -
equals
see if the ManagerProxy equals that. Considered equal if the index and classname match- Parameters:
that- Description- Returns:
- true if the index and the classname match
-
hashCode
public int hashCode()return the hashcode for the ManagerProxy -
getObserverCount
public int getObserverCount()- Returns:
- The ObserverCount value
-
hasBeenGCd
public boolean hasBeenGCd() -
setUserInterface
- Parameters:
frame-
-