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 es...@apache.org on 2007/08/21 06:48:59 UTC
svn commit: r567951 -
/portals/wsrp4j/trunk/commons-producer/src/java/org/apache/wsrp4j/commons/producer/provider/driver/PortletRegistrationFilterImpl.java
Author: esm
Date: Mon Aug 20 21:48:58 2007
New Revision: 567951
URL: http://svn.apache.org/viewvc?rev=567951&view=rev
Log:
Code formatting. Removed some log statements.
Modified:
portals/wsrp4j/trunk/commons-producer/src/java/org/apache/wsrp4j/commons/producer/provider/driver/PortletRegistrationFilterImpl.java
Modified: portals/wsrp4j/trunk/commons-producer/src/java/org/apache/wsrp4j/commons/producer/provider/driver/PortletRegistrationFilterImpl.java
URL: http://svn.apache.org/viewvc/portals/wsrp4j/trunk/commons-producer/src/java/org/apache/wsrp4j/commons/producer/provider/driver/PortletRegistrationFilterImpl.java?rev=567951&r1=567950&r2=567951&view=diff
==============================================================================
--- portals/wsrp4j/trunk/commons-producer/src/java/org/apache/wsrp4j/commons/producer/provider/driver/PortletRegistrationFilterImpl.java (original)
+++ portals/wsrp4j/trunk/commons-producer/src/java/org/apache/wsrp4j/commons/producer/provider/driver/PortletRegistrationFilterImpl.java Mon Aug 20 21:48:58 2007
@@ -45,7 +45,7 @@
public class PortletRegistrationFilterImpl
implements PortletRegistrationFilter, PortletRegistrationFilterWriter {
- private static final Log log =
+ private static final Log LOG =
LogFactory.getLog(PortletRegistrationFilterImpl.class);
// a filter
@@ -90,12 +90,6 @@
*/
private PortletRegistrationFilterImpl() {
- String MN = "PortletRegistrationFilterImpl";
-
- if (log.isDebugEnabled()) {
- log.debug(Utility.strEnter(MN));
- }
-
try {
ProducerPersistentFactory persistentFactory =
PersistentAccess.getProducerPersistentFactory();
@@ -106,15 +100,11 @@
restore();
} catch (WSRPException e) {
- if (log.isWarnEnabled()) {
- log.warn("Restore() failed!");
+ if (LOG.isWarnEnabled()) {
+ LOG.warn("Restore() failed!");
}
}
- if (log.isDebugEnabled()) {
- log.debug(Utility.strExit(MN));
- }
-
}
/**
@@ -128,17 +118,11 @@
* @return Iterator of portlet handles
*/
public Iterator getAvailable(String regHandle) {
- String MN = "getAvailable";
-
- if (log.isDebugEnabled()) {
- log.debug(Utility.strEnter(MN));
- }
-
Iterator iter = null;
if(consumerPortletRegistrationMap.containsKey(regHandle)) {
- if (log.isDebugEnabled()) {
- log.debug("RegistrationHandle: " + regHandle +
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("RegistrationHandle: " + regHandle +
" found in Map.");
}
@@ -148,10 +132,6 @@
iter = cpr.getPortletHandles().iterator();
}
- if (log.isDebugEnabled()) {
- log.debug(Utility.strExit(MN));
- }
-
return iter;
}
@@ -169,17 +149,12 @@
* regHandle is allowed to use the portlet identified by portletHandle
*/
public boolean isAvailable(String regHandle, String portletHandle) {
- String MN = "isAvailable";
-
- if (log.isDebugEnabled()) {
- log.debug(Utility.strEnter(MN));
- }
-
+
boolean retVal = false;
if(consumerPortletRegistrationMap.containsKey(regHandle)) {
- if (log.isDebugEnabled()) {
- log.debug("RegistrationHandle: " + regHandle +
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("RegistrationHandle: " + regHandle +
" found in Map.");
}
@@ -189,17 +164,13 @@
if(cpr.containsPortletHandle(portletHandle)) {
retVal = true;
- if (log.isDebugEnabled()) {
- log.debug("PortletHandle: " + portletHandle +
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("PortletHandle: " + portletHandle +
" found for registration.");
}
}
}
- if (log.isDebugEnabled()) {
- log.debug(Utility.strExit(MN));
- }
-
return retVal;
}
@@ -215,12 +186,7 @@
*/
public void makeAvailable(String regHandle, String portletHandle)
throws WSRPException {
- String MN = "makeAvailable";
-
- if (log.isDebugEnabled()) {
- log.debug(Utility.strEnter(MN));
- }
-
+
ConsumerPortletRegistrationImpl cpr = null;
if(!consumerPortletRegistrationMap.containsKey(regHandle)) {
@@ -240,10 +206,7 @@
persistentDataObject.addObject(cpr);
persistentDataObject.getPersistentInformation().setGroupID(regHandle);
store(persistentDataObject);
-
- if (log.isDebugEnabled()) {
- log.debug(Utility.strExit(MN));
- }
+
}
/**
@@ -261,19 +224,11 @@
*/
public void makeAvailable(String regHandle, Iterator portletHandles)
throws WSRPException {
- String MN = "makeAvailable";
-
- if (log.isDebugEnabled()) {
- log.debug(Utility.strEnter(MN));
- }
-
+
while(portletHandles.hasNext()) {
makeAvailable(regHandle,(String)portletHandles.next());
}
-
- if (log.isDebugEnabled()) {
- log.debug(Utility.strExit(MN));
- }
+
}
/**
@@ -284,11 +239,7 @@
* @param regHandle String representing the registration handle of a consumer
*/
public void remove(String regHandle) {
- String MN = "remove";
-
- if (log.isDebugEnabled()) {
- log.debug(Utility.strEnter(MN));
- }
+
if(consumerPortletRegistrationMap.containsKey(regHandle)) {
ConsumerPortletRegistrationImpl cpr =
@@ -304,16 +255,12 @@
try {
delete(persistentDataObject);
} catch (WSRPException e) {
- if (log.isErrorEnabled()) {
- log.error("Error while removing a portlet registration", e);
+ if (LOG.isErrorEnabled()) {
+ LOG.error("Error while removing a portlet registration", e);
}
}
}
- if (log.isDebugEnabled()) {
- log.debug(Utility.strExit(MN));
- }
-
}
/**
@@ -329,12 +276,6 @@
public void remove(String regHandle, String portletHandle)
throws WSRPException {
- String MN = "remove";
-
- if (log.isDebugEnabled()) {
- log.debug(Utility.strEnter(MN));
- }
-
if(consumerPortletRegistrationMap.containsKey(regHandle)) {
ConsumerPortletRegistrationImpl cpr =
(ConsumerPortletRegistrationImpl)
@@ -357,10 +298,6 @@
}
}
- if (log.isDebugEnabled()) {
- log.debug(Utility.strExit(MN));
- }
-
}
/**
@@ -376,11 +313,6 @@
*/
public void remove(String regHandle, Iterator portletHandles)
throws WSRPException {
- String MN = "remove";
-
- if (log.isDebugEnabled()) {
- log.debug(Utility.strEnter(MN));
- }
if(portletHandles != null) {
while(portletHandles.hasNext()) {
@@ -388,9 +320,6 @@
}
}
- if (log.isDebugEnabled()) {
- log.debug(Utility.strExit(MN));
- }
}
/**
@@ -400,18 +329,10 @@
*/
private void delete(PersistentDataObject persistentDataObject)
throws WSRPException {
- String MN = "delete";
-
- if (log.isDebugEnabled()) {
- log.debug(Utility.strEnter(MN));
- }
-
+
persistentHandler.delete(persistentDataObject);
- if (log.isDebugEnabled()) {
- log.debug(Utility.strExit(MN));
- }
-
+
}
/**
@@ -422,18 +343,10 @@
*/
private void store(PersistentDataObject persistentDataObject)
throws WSRPException {
- String MN = "store";
-
- if (log.isDebugEnabled()) {
- log.debug(Utility.strEnter(MN));
- }
+
persistentHandler.store(persistentDataObject);
-
- if (log.isDebugEnabled()) {
- log.debug(Utility.strExit(MN));
- }
-
+
}
/**
@@ -442,12 +355,7 @@
* @throws WSRPException
*/
private void restore() throws WSRPException {
-
- String MN = "restore";
-
- if (log.isDebugEnabled()) {
- log.debug(Utility.strEnter(MN));
- }
+
consumerPortletRegistrationMap.clear();
@@ -463,9 +371,7 @@
cpr.getRegistrationHandle(), cpr);
}
- if (log.isDebugEnabled()) {
- log.debug(Utility.strExit(MN));
- }
+
}
public HashMap getConsumerPortletRegistrationMap() {