org.globus.mds.aggregator.impl
Class AggregatorServiceGroupResource

java.lang.Object
  extended byorg.globus.mds.aggregator.impl.AggregatorServiceGroupResource
All Implemented Interfaces:
Resource, ResourceProperties, ServiceGroupRegistrationResource, ServiceGroupResource

public class AggregatorServiceGroupResource
extends java.lang.Object
implements ResourceProperties, ServiceGroupRegistrationResource

Implements an aggregating in-memory service group resource.
Entries will be stored in a hash table under each service group resource so that we can easily find them; the key for a service group entry must first contain the key to the appropriate service group and then the key within that to the appropriate entry.


Nested Class Summary
(package private)  class AggregatorServiceGroupResource.EntrySweeper
          Gets rid of dead registrations
 
Field Summary
(package private)  AggregatorConfiguration configuration
           
static long DEFAULT_SWEEP_PERIOD
          The default entry sweeper, in milliseconds.
(package private)  java.util.Hashtable entries
          Maps entry keys to entry resource objects.
(package private)  java.util.Hashtable entryCache
          A cache to return concurrency exception safe iterators from
(package private)  boolean entryCacheDirty
           
(package private)  AggregatorServiceGroupResource.EntrySweeper entrySweeper
           
private  ResourceKey key
           
private static org.apache.commons.logging.Log logger
           
(package private)  org.globus.mds.usefulrp.ServiceMetaDataResourceProperty metadata
           
(package private)  ResourcePropertySet propSet
           
static javax.xml.namespace.QName REGISTRATION_COUNT_RP
           
(package private)  org.globus.mds.usefulrp.AccumulatorResourceProperty registrationCountRP
           
static javax.xml.namespace.QName RP_SET
           
(package private)  java.util.Hashtable sessionKeys
          Maps entry keys to session keys.
(package private)  java.util.ArrayList sources
          the AggregationSource(s) used to populate content for this SG
private  long sweeperInterval
           
 
Constructor Summary
AggregatorServiceGroupResource()
           
 
Method Summary
 void addAggregatorSource(AggregatorSource source)
           
 AggregatorConfiguration getConfiguration()
           
 ResourceKey getKey()
           
 ResourcePropertySet getResourcePropertySet()
           
protected  void init(javax.xml.namespace.QName rpSetName)
           
private  boolean isEntryCacheDirty()
           
 java.util.Iterator iterateEntryKeys()
           
 java.util.Iterator iterateEntryValues()
           
 void loadCompatibleSources(AggregatorSink sink)
           
 void notifyChange()
           
 org.apache.axis.message.addressing.EndpointReferenceType serviceGroupAdd(Add add)
          Adds a registration to the AggregatingServiceGroup.
private  void setEntryCacheDirty(boolean dirty)
           
 void setVersion(java.lang.String version)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SWEEP_PERIOD

public static final long DEFAULT_SWEEP_PERIOD
The default entry sweeper, in milliseconds.

See Also:
Constant Field Values

logger

private static org.apache.commons.logging.Log logger

RP_SET

public static final javax.xml.namespace.QName RP_SET

REGISTRATION_COUNT_RP

public static final javax.xml.namespace.QName REGISTRATION_COUNT_RP

propSet

ResourcePropertySet propSet

entries

java.util.Hashtable entries
Maps entry keys to entry resource objects.


sessionKeys

java.util.Hashtable sessionKeys
Maps entry keys to session keys.


entryCache

java.util.Hashtable entryCache
A cache to return concurrency exception safe iterators from


entryCacheDirty

boolean entryCacheDirty

entrySweeper

AggregatorServiceGroupResource.EntrySweeper entrySweeper

sweeperInterval

private long sweeperInterval

sources

java.util.ArrayList sources
the AggregationSource(s) used to populate content for this SG


registrationCountRP

org.globus.mds.usefulrp.AccumulatorResourceProperty registrationCountRP

metadata

org.globus.mds.usefulrp.ServiceMetaDataResourceProperty metadata

configuration

AggregatorConfiguration configuration

key

private ResourceKey key
Constructor Detail

AggregatorServiceGroupResource

public AggregatorServiceGroupResource()
Method Detail

init

protected void init(javax.xml.namespace.QName rpSetName)

addAggregatorSource

public void addAggregatorSource(AggregatorSource source)

getResourcePropertySet

public ResourcePropertySet getResourcePropertySet()
Specified by:
getResourcePropertySet in interface ResourceProperties

setVersion

public void setVersion(java.lang.String version)

getKey

public ResourceKey getKey()

iterateEntryKeys

public java.util.Iterator iterateEntryKeys()
Specified by:
iterateEntryKeys in interface ServiceGroupResource

iterateEntryValues

public java.util.Iterator iterateEntryValues()
Specified by:
iterateEntryValues in interface ServiceGroupResource

isEntryCacheDirty

private boolean isEntryCacheDirty()

setEntryCacheDirty

private void setEntryCacheDirty(boolean dirty)

getConfiguration

public AggregatorConfiguration getConfiguration()

loadCompatibleSources

public void loadCompatibleSources(AggregatorSink sink)
                           throws java.lang.Exception
Throws:
java.lang.Exception

serviceGroupAdd

public org.apache.axis.message.addressing.EndpointReferenceType serviceGroupAdd(Add add)
                                                                         throws java.rmi.RemoteException,
                                                                                AddRefusedFaultType,
                                                                                ContentCreationFailedFaultType,
                                                                                UnsupportedMemberInterfaceFaultType
Adds a registration to the AggregatingServiceGroup. This has two main effects:
  1. it creates a service group entry for the registration (normal service group behaviour)
  2. it calls addAggregation on the specified source, passing in the newly created entry. TODO: should we pass in a key here rather than a reference to the service object in order to cope with activation/deactivation?

Specified by:
serviceGroupAdd in interface ServiceGroupRegistrationResource
Throws:
java.rmi.RemoteException
AddRefusedFaultType
ContentCreationFailedFaultType
UnsupportedMemberInterfaceFaultType

notifyChange

public void notifyChange()