|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jac.core.dist.Topology
This class defines a generic topology where nodes are a set of reachable containers.
It is used by the distribution aspect to define distribution, deployment, and replication schemes.
RemoteContainer
,
Serialized FormField Summary | |
boolean |
bootstrapFlag
|
List |
containers
Store the containers of the topology. |
protected static Topology |
globalTopology
Store the gobal topology of the JAC distributed system. |
List |
nameReps
Store the remote references on the name repository for optimization matter. |
Constructor Summary | |
Topology()
This constructor builds a topology and set it to global if a global topology does not exist yet. |
|
Topology(RemoteContainer[] someContainers)
Builds a topology from a set of containers. |
|
Topology(String[] someNames)
Builds a topology with the given container identifiers. |
Method Summary | |
void |
addContainer(RemoteContainer container)
Add a container to the topology if not already present. |
void |
addContainer(String container)
Adds a container from its name. |
void |
addContainers(RemoteContainer[] someContainers)
Add a set of containers to the topology. |
boolean |
containsLocal()
Tells if the current topology contains the local container. |
int |
countContainers()
Returns the number of containers in this topology. |
void |
createNameReps()
Creates the remote references on the name repositories. |
void |
dump()
Dump the containers of the topology. |
boolean |
exist(String name)
Says if an object exist on one of the container of the topology (excluding the local one). |
protected void |
fireTopologyChangeEvent()
Notifies everybody that the topology changed. |
static Topology |
get()
This method returns the gobal topology of the JAC distributed middleware. |
RemoteContainer |
getContainer(int index)
Returns a given container. |
RemoteContainer |
getContainer(String name)
Gets a container from its name. |
int |
getContainerIndex(RemoteContainer container)
Get the index of a container. |
int |
getContainerIndex(String name)
Get the index of a container from its name. |
int[] |
getContainerIndexes(gnu.regexp.RE regexp)
Get the indexes of some container regarding a regular expression on the name. |
int[] |
getContainerIndexes(String[] names)
Get the indexes of some container names. |
RemoteContainer[] |
getContainers()
Returns all the containers of the topology. |
RemoteContainer[] |
getContainers(gnu.regexp.RE regexp)
Get some containers regarding a regular expression on the name. |
RemoteContainer[] |
getDistContainers()
Returns the container of the topology minus the local one if any. |
RemoteContainer |
getFirstContainer(String sregexp)
This method returns the first container that matches the host expression. |
static Topology |
getPartialTopology(gnu.regexp.RE regexp)
This method returns a topology with all the containers that match the regular expression within the global topology of org.objectweb.jac. |
static Topology |
getPartialTopology(String regexp)
This method returns a topology with all the containers that match the regular expression within the global topology of org.objectweb.jac. |
Vector |
getReplicas(Wrappee localObject)
Gets a set of remote references on all the remote replicas of a local object for the current topology. |
static Topology |
getTopology(Application application)
Returns the topology defined for the given application. |
boolean |
isContainer(RemoteContainer container)
Check if the current topology contains the given container. |
void |
launchGUI()
Start the admin GUI |
void |
launchGUI(String programName)
Launches the administration GUI on the local container. |
void |
reloadAspect(String applicationName,
String aspectName)
Reload the configuration of an aspect |
void |
removeContainer(RemoteContainer container)
Remove a container from the topology. |
void |
replaceContainer(int index,
RemoteContainer newContainer)
Replace a container at a given index. |
void |
replaceContainer(RemoteContainer oldContainer,
RemoteContainer newContainer)
Replace a container by another container. |
static void |
reset()
Resets the global topology by re-resolving the different containers. |
static void |
setTopology(Application application,
Topology topology)
Sets the topology for a given application. |
void |
setTrace(String application,
String category,
int level)
Set a trace logging level |
void |
startSwingGUI(String application,
String[] guiNames)
Start some swing GUIs for an application. |
String |
toString()
Get a textual representation of the topology. |
void |
unweaveAspect(String applicationName,
String aspectName)
|
void |
weaveAspect(String applicationName,
String aspectClassName,
String configPath)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public boolean bootstrapFlag
protected static Topology globalTopology
public List containers
public List nameReps
Constructor Detail |
public Topology()
get()
public Topology(String[] someNames)
This method transforms the names into remote containers
references by calling resolve
.
someNames
- a set of container namesRemoteContainer.resolve(String)
public Topology(RemoteContainer[] someContainers)
someContainers
- the container of the new topologygetContainers()
,
getContainer(int)
,
getDistContainers()
Method Detail |
public static Topology getTopology(Application application)
application
- the application
public static void setTopology(Application application, Topology topology)
application
- the applicationtopology
- the corresponding topologypublic static Topology get()
This instance of topology is set in strong consistency so that all the container of the distributed name/aspect space are notified when a container is added or removed.
public static void reset()
public static Topology getPartialTopology(gnu.regexp.RE regexp)
regexp
- a regular expression on the container names
getPartialTopology(String)
public RemoteContainer getFirstContainer(String sregexp)
public static Topology getPartialTopology(String regexp)
regexp
- a regular expression (as a string) on the
container names
public void createNameReps()
This method is used for optimization reasons. Indeed, it allows the topology to avoid the dynamic resolution of the containers when accessing them.
getContainers()
,
getContainer(int)
,
getDistContainers()
public RemoteContainer[] getContainers()
getContainer(int)
,
getDistContainers()
public RemoteContainer getContainer(int index)
index
- a valid index
getContainers()
,
getDistContainers()
public RemoteContainer[] getDistContainers()
This method is typically used to deploy objects on a topology (when you do not want the object to be also depoyed on the local container).
RemoteContainer.isLocal()
,
getContainers()
,
getContainer(int)
public boolean containsLocal()
public Vector getReplicas(Wrappee localObject)
localObject
- the local object of which the replicas are
seeked
public boolean exist(String name)
name
- the name of the object to check
public int getContainerIndex(RemoteContainer container)
container
- a container
getContainer(int)
,
getContainerIndex(String)
public int getContainerIndex(String name)
name
- a container name
getContainer(int)
,
getContainerIndex(RemoteContainer)
,
getContainerIndexes(RE)
,
getContainerIndexes(String[])
public int[] getContainerIndexes(gnu.regexp.RE regexp)
regexp
- a regular expression
getContainer(int)
,
getContainerIndex(String)
,
getContainerIndexes(String[])
public RemoteContainer[] getContainers(gnu.regexp.RE regexp)
regexp
- a regular expression
getContainer(int)
,
getContainerIndex(String)
,
getContainerIndexes(String[])
,
getContainerIndexes(RE)
public int[] getContainerIndexes(String[] names)
names
- an array containing the names
getContainer(int)
,
getContainerIndex(RemoteContainer)
,
getContainerIndexes(RE)
public void addContainer(RemoteContainer container)
container
- the container to addaddContainers(RemoteContainer[])
public void addContainer(String container)
container
- the container namepublic void addContainers(RemoteContainer[] someContainers)
someContainers
- a set of containers to addaddContainer(RemoteContainer)
public void removeContainer(RemoteContainer container)
container
- the container to be removedpublic boolean isContainer(RemoteContainer container)
container
- the container to check
public void replaceContainer(int index, RemoteContainer newContainer)
index
- the index where the container has to be substitutednewContainer
- the container to setreplaceContainer(RemoteContainer,RemoteContainer)
public void replaceContainer(RemoteContainer oldContainer, RemoteContainer newContainer)
oldContainer
- the container to replace (must be in the topology)newContainer
- the replacing containerreplaceContainer(int,RemoteContainer)
public RemoteContainer getContainer(String name)
name
- the name to seek
public int countContainers()
protected void fireTopologyChangeEvent()
public void dump()
public void launchGUI(String programName)
public void launchGUI()
public void startSwingGUI(String application, String[] guiNames)
application
- the name of the application for which to
start the GUIsguiNames
- the names of the GUI windows to startpublic void reloadAspect(String applicationName, String aspectName)
public void unweaveAspect(String applicationName, String aspectName)
public void weaveAspect(String applicationName, String aspectClassName, String configPath)
public void setTrace(String application, String category, int level)
Log.trace(String,int,String)
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |