Dashboard > Penrose > ... > Penrose 0.9.9 Embedding Penrose > Penrose 0.9.9 Partition Manager
Penrose 0.9.9 Partition Manager
Added by Endi S. Dewata, last edited by Endi S. Dewata on Jan 24, 2006
Labels: 
(None)


Introduction

Penrose uses a PartitionManager to manage the life cycle of the partitions. When you instantiate the Penrose object, none of the partitions are loaded initially. You can optionally load the partitions manually. When Penrose is started, it will automatically load all remaining partitions that are still unloaded. If you stop Penrose, the partitions will remain loaded. You can optionally unload the partitions manually. If you restart Penrose, it will only reload the partitions that have been unloaded.

To get the PartitionManager:

Penrose penrose = ...
PartitionManager partitionManager = penrose.getPartitionManager();

Loading Partitions

You can load a partition manually as follows. If you load a partition manually, Penrose will not load it again when it's started.

String partitionName = "example";
Partition partition = ...
partitionManager.addPartition(partitionName, partition);

Retrieving Partitions

You can retrieve a Partition object after it's been loaded by the PartitionManager.

String partitionName = "example";
Partition partition = partitionManager.getPartition(partitionName);

Unloading Partitions

If you stop Penrose then make some changes to the partition configuration files, you have to unload the partition from the PartitionManager so that the configuration files will be reloaded when you start Penrose again.

String partitionName = "example";
partitionManager.removePartition(partitionName);

To unload all partitions:

partitionManager.clear();

Site running on a free Atlassian Confluence Open Source Project License granted to Safehaus. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators