|
P-Grid v2.0a2 API Specification | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectp2p.storage.StorageFactory
public abstract class StorageFactory
Abstract Factory (GoF) that defines the operations that create various objects of the Storage subsystem. It is recommended to instantiate such types only through a concrete implementation of this factory to avoid hard-coding direct references to them. This class provides static methods to find concrete factories using the reflection API to further decouple the subsystem from its client.
| Constructor Summary | |
|---|---|
StorageFactory()
|
|
| Method Summary | |
|---|---|
abstract DataItem |
createDataItem(Type type,
Object data)
Create a DataItem instance compatible with the Storage implementation. |
abstract Query |
createQuery(Type type,
String queryString)
Create a Query instance compatible with the Storage implementation. |
abstract Query |
createQuery(Type type,
String lowerBound,
String higherBound)
Create a Query instance compatible with the Storage implementation. |
abstract Storage |
createStorage(P2P p2p)
Create the concrete Storage implementation. |
abstract Type |
createType(String type)
Creates a Type instance compatible with the Storage implementation. |
abstract void |
registerTypeHandler(Type type,
TypeHandler handler)
Registers a Type Handler instance for a given Type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StorageFactory()
| Method Detail |
|---|
public abstract DataItem createDataItem(Type type,
Object data)
throws NoSuchTypeException
type - the data item's typedata - the encapsulated data
NoSuchTypeException - if the provided Type is unknown.
public abstract Query createQuery(Type type,
String queryString)
throws NoSuchTypeException
type - the Type of items the query is forqueryString - the string object that defines the query
NoSuchTypeException - if the provided Type is unknown.
public abstract Query createQuery(Type type,
String lowerBound,
String higherBound)
throws NoSuchTypeException
type - the Type of items the query is forlowerBound - the string object that defines the lower bound of the queryhigherBound - the string object that defines the higher bound of the query
NoSuchTypeException - if the provided Type is unknown.public abstract Storage createStorage(P2P p2p)
p2p - the P2P implementation.
public abstract Type createType(String type)
type - an application-specific type to encapsulate
public abstract void registerTypeHandler(Type type,
TypeHandler handler)
throws NoSuchTypeException
type - an application-specific type to encapsulatehandler - an application-specific type handler to encapsulate
NoSuchTypeException - if the provided Type is unknown.
|
P-Grid v2.0a2 API Specification | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||