[Registry-dev] svn commit r6578 - in
trunk/registry/java/modules/core/src/main/java/org/wso2/registry:
engine inmemory
svn at wso2.org
svn at wso2.org
Sat Aug 25 08:52:45 PDT 2007
Author: chathura
Date: Sat Aug 25 08:52:37 2007
New Revision: 6578
Modified:
trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RegistryEngine.java
trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RequestContext.java
trunk/registry/java/modules/core/src/main/java/org/wso2/registry/inmemory/InMemoryRegistry.java
Log:
Improvements to the registry engine.
Modified: trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RegistryEngine.java
==============================================================================
--- trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RegistryEngine.java (original)
+++ trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RegistryEngine.java Sat Aug 25 08:52:37 2007
@@ -21,6 +21,8 @@
import org.wso2.registry.Registry;
import org.wso2.registry.RegistryException;
+import org.wso2.registry.Actions;
+import org.wso2.registry.resources.Resource;
import org.wso2.registry.handlers.Handler;
/**
@@ -56,10 +58,17 @@
// get the media type specific handler chain from the registry
// invoke the media type specific handler chain
- // invoke the registry method according to the requestContext.action
-
+ // invoke the registry method according to the requestContext.action
// fill the responseContent with the response
- return null;
+ ResponseContext responseContext = new ResponseContext();
+ String action = requestContext.getAction();
+
+ if (action.equals(Actions.GET)) {
+ Resource resource = registry.get(requestContext.getUri());
+ responseContext.setResource(resource);
+ }
+
+ return responseContext;
}
}
Modified: trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RequestContext.java
==============================================================================
--- trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RequestContext.java (original)
+++ trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RequestContext.java Sat Aug 25 08:52:37 2007
@@ -24,8 +24,9 @@
public class RequestContext {
private Session session;
+ private String uri;
private Resource resource;
- private int action;
+ private String action;
public Session getSession() {
return session;
@@ -35,6 +36,14 @@
this.session = session;
}
+ public String getUri() {
+ return uri;
+ }
+
+ public void setUri(String uri) {
+ this.uri = uri;
+ }
+
public Resource getResource() {
return resource;
}
@@ -43,11 +52,11 @@
this.resource = resource;
}
- public int getAction() {
+ public String getAction() {
return action;
}
- public void setAction(int action) {
+ public void setAction(String action) {
this.action = action;
}
}
Modified: trunk/registry/java/modules/core/src/main/java/org/wso2/registry/inmemory/InMemoryRegistry.java
==============================================================================
--- trunk/registry/java/modules/core/src/main/java/org/wso2/registry/inmemory/InMemoryRegistry.java (original)
+++ trunk/registry/java/modules/core/src/main/java/org/wso2/registry/inmemory/InMemoryRegistry.java Sat Aug 25 08:52:37 2007
@@ -44,7 +44,9 @@
* cache for a persistance registry.
*/
public class InMemoryRegistry implements Registry {
+
protected static final Log log = LogFactory.getLog(InMemoryRegistry.class);
+
private TagManager tagManager = new TagManager(this);
private CommentManager commentManager = new CommentManager(this);
private RatingsManager ratingManager = new RatingsManager(this);
More information about the Registry-dev
mailing list