You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrp4j-dev@portals.apache.org by jm...@apache.org on 2006/01/31 17:04:07 UTC
svn commit: r373849 - in /portals/wsrp4j/trunk/sandbox/wsrp4j:
commons/src/java/org/apache/wsrp4j/commons/persistence/
consumer/src/java/org/apache/wsrp4j/consumer/proxyportlet/impl/
persistence-xml/src/java/org/apache/wsrp4j/persistence/xml/ persisten...
Author: jmacna
Date: Tue Jan 31 08:03:42 2006
New Revision: 373849
URL: http://svn.apache.org/viewcvs?rev=373849&view=rev
Log:
Refactor server-side persistence to remove dependency on
consumer-side objects.
Modified:
portals/wsrp4j/trunk/sandbox/wsrp4j/commons/src/java/org/apache/wsrp4j/commons/persistence/ClientPersistentFactory.java
portals/wsrp4j/trunk/sandbox/wsrp4j/commons/src/java/org/apache/wsrp4j/commons/persistence/PersistentFactory.java
portals/wsrp4j/trunk/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/proxyportlet/impl/ProducerRegistryImpl.java
portals/wsrp4j/trunk/sandbox/wsrp4j/persistence-xml/src/java/org/apache/wsrp4j/persistence/xml/ServerPersistentInformationProvider.java
portals/wsrp4j/trunk/sandbox/wsrp4j/persistence-xml/src/java/org/apache/wsrp4j/persistence/xml/driver/ServerPersistentFactoryImpl.java
portals/wsrp4j/trunk/sandbox/wsrp4j/persistence-xml/src/java/org/apache/wsrp4j/persistence/xml/driver/ServerPersistentInformationProviderImpl.java
Modified: portals/wsrp4j/trunk/sandbox/wsrp4j/commons/src/java/org/apache/wsrp4j/commons/persistence/ClientPersistentFactory.java
URL: http://svn.apache.org/viewcvs/portals/wsrp4j/trunk/sandbox/wsrp4j/commons/src/java/org/apache/wsrp4j/commons/persistence/ClientPersistentFactory.java?rev=373849&r1=373848&r2=373849&view=diff
==============================================================================
--- portals/wsrp4j/trunk/sandbox/wsrp4j/commons/src/java/org/apache/wsrp4j/commons/persistence/ClientPersistentFactory.java (original)
+++ portals/wsrp4j/trunk/sandbox/wsrp4j/commons/src/java/org/apache/wsrp4j/commons/persistence/ClientPersistentFactory.java Tue Jan 31 08:03:42 2006
@@ -49,4 +49,28 @@
public PersistentDataObject getConsumerPortletContextList()
throws WSRPException;
+
+ /**
+ * Returns the PortletList
+ *
+ * @return PersistentDataObject
+ */
+ public PersistentDataObject getPortletList() throws WSRPException;
+
+
+ /**
+ * Returns the ProducerList
+ *
+ * @return PersistentDataObject
+ */
+ public PersistentDataObject getProducerList() throws WSRPException;
+
+
+ /**
+ * Returns the UserList
+ *
+ * @return PersistentDataObject
+ */
+ public PersistentDataObject getUserList() throws WSRPException;
+
}
Modified: portals/wsrp4j/trunk/sandbox/wsrp4j/commons/src/java/org/apache/wsrp4j/commons/persistence/PersistentFactory.java
URL: http://svn.apache.org/viewcvs/portals/wsrp4j/trunk/sandbox/wsrp4j/commons/src/java/org/apache/wsrp4j/commons/persistence/PersistentFactory.java?rev=373849&r1=373848&r2=373849&view=diff
==============================================================================
--- portals/wsrp4j/trunk/sandbox/wsrp4j/commons/src/java/org/apache/wsrp4j/commons/persistence/PersistentFactory.java (original)
+++ portals/wsrp4j/trunk/sandbox/wsrp4j/commons/src/java/org/apache/wsrp4j/commons/persistence/PersistentFactory.java Tue Jan 31 08:03:42 2006
@@ -44,26 +44,4 @@
*/
public PersistentInformationProvider getPersistentInformationProvider();
-
- /**
- * Returns the PortletList
- *
- * @return PersistentDataObject
- */
- public PersistentDataObject getPortletList() throws WSRPException;
-
- /**
- * Returns the UserList
- *
- * @return PersistentDataObject
- */
- public PersistentDataObject getUserList() throws WSRPException;
-
- /**
- * Returns the ProducerList
- *
- * @return PersistentDataObject
- */
- public PersistentDataObject getProducerList() throws WSRPException;
-
}
Modified: portals/wsrp4j/trunk/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/proxyportlet/impl/ProducerRegistryImpl.java
URL: http://svn.apache.org/viewcvs/portals/wsrp4j/trunk/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/proxyportlet/impl/ProducerRegistryImpl.java?rev=373849&r1=373848&r2=373849&view=diff
==============================================================================
--- portals/wsrp4j/trunk/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/proxyportlet/impl/ProducerRegistryImpl.java (original)
+++ portals/wsrp4j/trunk/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/proxyportlet/impl/ProducerRegistryImpl.java Tue Jan 31 08:03:42 2006
@@ -19,9 +19,9 @@
import org.apache.wsrp4j.commons.consumer.interfaces.producer.ProducerRegistry;
import org.apache.wsrp4j.commons.consumer.driver.GenericPersistentProducerRegistryImpl;
import org.apache.wsrp4j.commons.exception.WSRPException;
-import org.apache.wsrp4j.commons.persistence.ServerPersistentFactory;
+import org.apache.wsrp4j.commons.persistence.ClientPersistentFactory;
import org.apache.wsrp4j.commons.persistence.driver.PersistentAccess;
-import org.apache.wsrp4j.persistence.xml.driver.ServerPersistentFactoryImpl;
+import org.apache.wsrp4j.persistence.xml.driver.ClientPersistentFactoryImpl;
/**
@@ -41,9 +41,9 @@
try
{
- ServerPersistentFactory persistentFactory =
- PersistentAccess.getServerPersistentFactory();
- ((ServerPersistentFactoryImpl)persistentFactory).setPath(path);
+ ClientPersistentFactory persistentFactory =
+ PersistentAccess.getClientPersistentFactory();
+// ((ClientPersistentFactoryImpl)persistentFactory).setPath(path);
persistentHandler = persistentFactory.getPersistentHandler();
persistentDataObject = persistentFactory.getProducerList();
Modified: portals/wsrp4j/trunk/sandbox/wsrp4j/persistence-xml/src/java/org/apache/wsrp4j/persistence/xml/ServerPersistentInformationProvider.java
URL: http://svn.apache.org/viewcvs/portals/wsrp4j/trunk/sandbox/wsrp4j/persistence-xml/src/java/org/apache/wsrp4j/persistence/xml/ServerPersistentInformationProvider.java?rev=373849&r1=373848&r2=373849&view=diff
==============================================================================
--- portals/wsrp4j/trunk/sandbox/wsrp4j/persistence-xml/src/java/org/apache/wsrp4j/persistence/xml/ServerPersistentInformationProvider.java (original)
+++ portals/wsrp4j/trunk/sandbox/wsrp4j/persistence-xml/src/java/org/apache/wsrp4j/persistence/xml/ServerPersistentInformationProvider.java Tue Jan 31 08:03:42 2006
@@ -86,9 +86,9 @@
*
* @return PersistentInformation
*/
- public PersistentInformation getPersistentInformation(
+/* public PersistentInformation getPersistentInformation(
ProducerList producerList);
-
+*/
/**
* Returns the persistent file information for the user
*
@@ -96,8 +96,8 @@
*
* @return PersistentInformation
*/
- public PersistentInformation getPersistentInformation(UserList userList);
-
+/* public PersistentInformation getPersistentInformation(UserList userList);
+*/
/**
* Returns the persistent file information for the Portlet
*
@@ -105,9 +105,9 @@
*
* @return PersistentInformation
*/
- public PersistentInformation getPersistentInformation(
+/* public PersistentInformation getPersistentInformation(
PortletList portletList);
-
+*/
/**
* Returns the persistent file information for the
* ConsumerPortletRegistrationList
Modified: portals/wsrp4j/trunk/sandbox/wsrp4j/persistence-xml/src/java/org/apache/wsrp4j/persistence/xml/driver/ServerPersistentFactoryImpl.java
URL: http://svn.apache.org/viewcvs/portals/wsrp4j/trunk/sandbox/wsrp4j/persistence-xml/src/java/org/apache/wsrp4j/persistence/xml/driver/ServerPersistentFactoryImpl.java?rev=373849&r1=373848&r2=373849&view=diff
==============================================================================
--- portals/wsrp4j/trunk/sandbox/wsrp4j/persistence-xml/src/java/org/apache/wsrp4j/persistence/xml/driver/ServerPersistentFactoryImpl.java (original)
+++ portals/wsrp4j/trunk/sandbox/wsrp4j/persistence-xml/src/java/org/apache/wsrp4j/persistence/xml/driver/ServerPersistentFactoryImpl.java Tue Jan 31 08:03:42 2006
@@ -127,80 +127,6 @@
/**
- * Returns the PortletList
- *
- * @return PersistentDataObject
- * @throws WSRPException
- */
- public PersistentDataObject getPortletList() throws WSRPException {
-
- String MN = "getPortletList";
- if (logger.isLogging(Logger.TRACE_HIGH)) {
- logger.entry(Logger.TRACE_HIGH, MN);
- }
-
- PortletList pdo = null;
-
- try {
- pdo = (PortletList) Class.forName(
- "org.apache.wsrp4j.persistence.xml.driver." +
- "PortletList").newInstance();
-
- ((ServerPersistentInformationProvider)
- getPersistentInformationProvider()).getPersistentInformation(pdo);
-
-
- } catch (Exception e) {
- // could not find class
- WSRPXHelper.throwX(logger, Logger.ERROR, MN, 1003, e);
- }
-
- if (logger.isLogging(Logger.TRACE_HIGH)) {
- logger.exit(Logger.TRACE_HIGH, MN);
- }
-
- return pdo;
- }
-
-
- /**
- * Returns the ProducerList
- *
- * @return PersistentDataObject
- * @throws WSRPException
- */
- public PersistentDataObject getProducerList() throws WSRPException {
-
- String MN = "getProducerList";
- if (logger.isLogging(Logger.TRACE_HIGH)) {
- logger.entry(Logger.TRACE_HIGH, MN);
- }
-
- ProducerList pdo = null;
-
- try {
-
- pdo = (ProducerList) Class.forName(
- "org.apache.wsrp4j.persistence.xml.driver." +
- "ProducerList").newInstance();
-
- ((ServerPersistentInformationProvider)
- getPersistentInformationProvider()).getPersistentInformation(pdo);
-
- } catch (Exception e) {
- // could not find class
- WSRPXHelper.throwX(logger, Logger.ERROR, MN, 1003, e);
- }
-
- if (logger.isLogging(Logger.TRACE_HIGH)) {
- logger.exit(Logger.TRACE_HIGH, MN);
- }
-
- return pdo;
- }
-
-
- /**
* Returns the RegistrationList
*
* @return PersistentDataObject
@@ -220,41 +146,6 @@
pdo = (RegistrationList) Class.forName(
"org.apache.wsrp4j.persistence.xml.driver." +
"RegistrationList").newInstance();
-
- ((ServerPersistentInformationProvider)
- getPersistentInformationProvider()).getPersistentInformation(pdo);
-
- } catch (Exception e) {
- // could not find class
- WSRPXHelper.throwX(logger, Logger.ERROR, MN, 1003, e);
- }
-
- if (logger.isLogging(Logger.TRACE_HIGH)) {
- logger.exit(Logger.TRACE_HIGH, MN);
- }
-
- return pdo;
- }
-
- /**
- * Returns the UserList
- *
- * @return PersistentDataObject
- * @throws WSRPException
- */
- public PersistentDataObject getUserList() throws WSRPException {
-
- String MN = "getUserList";
- if (logger.isLogging(Logger.TRACE_HIGH)) {
- logger.entry(Logger.TRACE_HIGH, MN);
- }
-
- UserList pdo = null;
-
- try {
- pdo = (UserList) Class.forName(
- "org.apache.wsrp4j.persistence.xml.driver." +
- "UserList").newInstance();
((ServerPersistentInformationProvider)
getPersistentInformationProvider()).getPersistentInformation(pdo);
Modified: portals/wsrp4j/trunk/sandbox/wsrp4j/persistence-xml/src/java/org/apache/wsrp4j/persistence/xml/driver/ServerPersistentInformationProviderImpl.java
URL: http://svn.apache.org/viewcvs/portals/wsrp4j/trunk/sandbox/wsrp4j/persistence-xml/src/java/org/apache/wsrp4j/persistence/xml/driver/ServerPersistentInformationProviderImpl.java?rev=373849&r1=373848&r2=373849&view=diff
==============================================================================
--- portals/wsrp4j/trunk/sandbox/wsrp4j/persistence-xml/src/java/org/apache/wsrp4j/persistence/xml/driver/ServerPersistentInformationProviderImpl.java (original)
+++ portals/wsrp4j/trunk/sandbox/wsrp4j/persistence-xml/src/java/org/apache/wsrp4j/persistence/xml/driver/ServerPersistentInformationProviderImpl.java Tue Jan 31 08:03:42 2006
@@ -26,9 +26,6 @@
import org.apache.axis.AxisEngine;
import org.apache.axis.MessageContext;
import org.apache.axis.transport.http.HTTPConstants;
-import org.apache.wsrp4j.commons.consumer.driver.ProducerImpl;
-import org.apache.wsrp4j.commons.consumer.driver.UserImpl;
-import org.apache.wsrp4j.commons.consumer.driver.WSRPPortletImpl;
import org.apache.wsrp4j.commons.log.LogManager;
import org.apache.wsrp4j.commons.log.Logger;
import org.apache.wsrp4j.commons.producer.interfaces.Registration;
@@ -415,101 +412,9 @@
}
- /**
- * Returns the persistent file information for the producers
- *
- * @param producerList
- *
- * @return PersistentInformation
- */
- public PersistentInformation getPersistentInformation(
- ProducerList producerList) {
-
- logger.entry(Logger.TRACE_HIGH, "getPersistentInformation");
-
- PersistentInformationXML persistentInfo = null;
-
- if (producerList != null) {
- persistentInfo = new PersistentInformationImpl();
- persistentInfo.setStoreDirectory(getStoreDirectory(PRODUCERS));
- persistentInfo.setMappingFileName(getMappingFile(PRODUCER_MAPPING));
- ProducerImpl producer = new ProducerImpl();
- persistentInfo.setFilenameStub(producer.getClass().getName());
- persistentInfo.setFilename(null);
- persistentInfo.setExtension(FILE_EXTENSION);
- persistentInfo.setSeparator(SEPARATOR);
- producerList.setPersistentInformation(persistentInfo);
- makeStoreSubDir(PRODUCERS);
- }
-
- logger.exit(Logger.TRACE_HIGH, "getPersistentInformation");
-
- return persistentInfo;
- }
- /**
- * Returns the persistent file information for the user
- *
- * @param userList
- *
- * @return PersistentInformation
- */
- public PersistentInformation getPersistentInformation(UserList userList) {
-
- logger.entry(Logger.TRACE_HIGH, "getPersistentInformation");
-
- PersistentInformationXML persistentInfo = null;
-
- if (userList != null) {
- persistentInfo = new PersistentInformationImpl();
- persistentInfo.setStoreDirectory(getStoreDirectory(USERS));
- persistentInfo.setMappingFileName(getMappingFile(USER_MAPPING));
- UserImpl user = new UserImpl();
- persistentInfo.setFilenameStub(user.getClass().getName());
- persistentInfo.setFilename(null);
- persistentInfo.setExtension(FILE_EXTENSION);
- persistentInfo.setSeparator(SEPARATOR);
- userList.setPersistentInformation(persistentInfo);
- makeStoreSubDir(USERS);
- }
-
- logger.exit(Logger.TRACE_HIGH, "getPersistentInformation");
-
- return persistentInfo;
- }
-
- /**
- * Returns the persistent file information for the Portlet
- *
- * @param portletList
- *
- * @return PersistentInformation
- */
- public PersistentInformation getPersistentInformation(
- PortletList portletList) {
-
- logger.entry(Logger.TRACE_HIGH, "getPersistentInformation");
-
- PersistentInformationXML persistentInfo = null;
-
- if (portletList != null) {
- persistentInfo = new PersistentInformationImpl();
- persistentInfo.setStoreDirectory(getStoreDirectory(PORTLETS));
- persistentInfo.setMappingFileName(getMappingFile(PORTLET_MAPPING));
- WSRPPortletImpl portlet = new WSRPPortletImpl();
- persistentInfo.setFilenameStub(portlet.getClass().getName());
- persistentInfo.setFilename(null);
- persistentInfo.setExtension(FILE_EXTENSION);
- persistentInfo.setSeparator(SEPARATOR);
- portletList.setPersistentInformation(persistentInfo);
- makeStoreSubDir(PORTLETS);
- }
-
- logger.exit(Logger.TRACE_HIGH, "getPersistentInformation");
-
- return persistentInfo;
- }
+
/**
* Returns the persistent file information for the
* ConsumerPortletRegistrationList