Author: chris.laprun(a)jboss.com
Date: 2011-03-17 16:42:23 -0400 (Thu, 17 Mar 2011)
New Revision: 6085
Removed:
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/jcr/mapping/Utils.java
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPConstants.java
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/migration/mapping/ExportInfoMapping.java
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/registry/mapping/RegistrationInfoMapping.java
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/registration/mapping/RegistrationMapping.java
components/wsrp/trunk/pom.xml
Log:
- GTNWSRP-90: Upgraded to Common 2.0.4-Beta02.
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPConstants.java
===================================================================
---
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPConstants.java 2011-03-17
20:24:57 UTC (rev 6084)
+++
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPConstants.java 2011-03-17
20:42:23 UTC (rev 6085)
@@ -23,6 +23,7 @@
package org.gatein.wsrp;
+import org.gatein.common.RuntimeContext;
import org.gatein.pc.api.spi.PortalContext;
import javax.xml.namespace.QName;
@@ -43,8 +44,7 @@
*/
public final class WSRPConstants
{
- // public static final boolean RUNS_IN_EPP =
RuntimeContext.getInstance().isRunningIn(RuntimeContext.RunningEnvironment.epp); // todo:
GTNWSRP-90: Use RuntimeContext from common when possible
- public static final boolean RUNS_IN_EPP;
+ public static final boolean RUNS_IN_EPP =
RuntimeContext.getInstance().isRunningIn(RuntimeContext.RunningEnvironment.epp);
/**
* The version of the WSRP service. This should match the maven version of the module.
Right now, checked via the
@@ -52,8 +52,6 @@
*/
public static final String WSRP_SERVICE_VERSION;
- private static final String GATEIN_RUNTIME_CONTEXT_PROP_NAME =
"gatein.runtime.context"; // todo: remove when GTNWSRP-90 is fixed
-
static
{
Properties props = new Properties();
@@ -66,8 +64,6 @@
throw new RuntimeException("Could not load wsrp.properties.");
}
WSRP_SERVICE_VERSION = props.getProperty("wsrp.service.version");
-
- RUNS_IN_EPP =
"epp".equals(System.getProperty(GATEIN_RUNTIME_CONTEXT_PROP_NAME)); // todo:
remove when GTNWSRP-90 is fixed
}
Modified:
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/migration/mapping/ExportInfoMapping.java
===================================================================
---
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/migration/mapping/ExportInfoMapping.java 2011-03-17
20:24:57 UTC (rev 6084)
+++
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/migration/mapping/ExportInfoMapping.java 2011-03-17
20:42:23 UTC (rev 6085)
@@ -27,10 +27,10 @@
import org.chromattic.api.annotations.OneToMany;
import org.chromattic.api.annotations.PrimaryType;
import org.chromattic.api.annotations.Property;
+import org.gatein.common.io.IOTools;
import org.gatein.wsrp.consumer.migration.ExportInfo;
import org.gatein.wsrp.jcr.ChromatticPersister;
import org.gatein.wsrp.jcr.mapping.BaseMapping;
-import org.gatein.wsrp.jcr.mapping.Utils;
import javax.xml.namespace.QName;
import java.io.ByteArrayInputStream;
@@ -128,7 +128,7 @@
SortedMap<String, byte[]> states = new TreeMap<String, byte[]>();
for (ExportedStateMapping exportedState : exportedStates)
{
-
states.put(ChromatticPersister.PortletNameFormatter.decode(exportedState.getHandle()),
Utils.safeGetBytes(exportedState.getState()));
+
states.put(ChromatticPersister.PortletNameFormatter.decode(exportedState.getHandle()),
IOTools.safeGetBytes(exportedState.getState()));
}
List<ExportErrorMapping> errors = getErrors();
@@ -138,6 +138,6 @@
errorCodesToHandles.put(error.getErrorCode(), error.getPortletHandles());
}
- return new ExportInfo(getExportTime(), errorCodesToHandles, states,
Utils.safeGetBytes(getExportContext()));
+ return new ExportInfo(getExportTime(), errorCodesToHandles, states,
IOTools.safeGetBytes(getExportContext()));
}
}
Modified:
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/registry/mapping/RegistrationInfoMapping.java
===================================================================
---
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/registry/mapping/RegistrationInfoMapping.java 2011-03-17
20:24:57 UTC (rev 6084)
+++
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/registry/mapping/RegistrationInfoMapping.java 2011-03-17
20:42:23 UTC (rev 6085)
@@ -28,10 +28,10 @@
import org.chromattic.api.annotations.OneToMany;
import org.chromattic.api.annotations.PrimaryType;
import org.chromattic.api.annotations.Property;
+import org.gatein.common.io.IOTools;
import org.gatein.wsrp.consumer.RegistrationInfo;
import org.gatein.wsrp.consumer.RegistrationProperty;
import org.gatein.wsrp.jcr.ChromatticPersister;
-import org.gatein.wsrp.jcr.mapping.Utils;
import org.gatein.wsrp.registration.RegistrationPropertyDescription;
import org.gatein.wsrp.registration.mapping.RegistrationPropertyDescriptionMapping;
@@ -99,7 +99,7 @@
{
initial.setConsumerName(getConsumerName());
initial.setRegistrationHandle(getRegistrationHandle());
- initial.setRegistrationState(Utils.safeGetBytes(getRegistrationState()));
+ initial.setRegistrationState(IOTools.safeGetBytes(getRegistrationState()));
// registration properties
for (RegistrationPropertyMapping rpm : getRegistrationProperties())
Deleted:
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/jcr/mapping/Utils.java
===================================================================
---
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/jcr/mapping/Utils.java 2011-03-17
20:24:57 UTC (rev 6084)
+++
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/jcr/mapping/Utils.java 2011-03-17
20:42:23 UTC (rev 6085)
@@ -1,62 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2011, Red Hat Middleware, LLC, and individual
- * contributors as indicated by the @authors tag. See the
- * copyright.txt in the distribution for a full listing of
- * individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.gatein.wsrp.jcr.mapping;
-
-import org.gatein.common.io.IOTools;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- * @deprecated Remove when we can use common 2.0.4 GTNWSRP-90
- */
-public class Utils
-{
- public static byte[] safeGetBytes(InputStream is)
- {
- byte[] bytes;
-
- if (is == null)
- {
- return null;
- }
-
- try
- {
- bytes = IOTools.getBytes(is);
- return bytes;
- }
- catch (IOException ignore)
- {
- // todo: should log
- return null;
- }
- finally
- {
- IOTools.safeClose(is);
- }
- }
-}
Modified:
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/registration/mapping/RegistrationMapping.java
===================================================================
---
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/registration/mapping/RegistrationMapping.java 2011-03-17
20:24:57 UTC (rev 6084)
+++
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/registration/mapping/RegistrationMapping.java 2011-03-17
20:42:23 UTC (rev 6085)
@@ -31,6 +31,7 @@
import org.chromattic.api.annotations.Owner;
import org.chromattic.api.annotations.PrimaryType;
import org.chromattic.api.annotations.Property;
+import org.gatein.common.io.IOTools;
import org.gatein.common.util.ParameterValidation;
import org.gatein.pc.api.PortletContext;
import org.gatein.pc.api.PortletStateType;
@@ -40,7 +41,6 @@
import org.gatein.registration.RegistrationStatus;
import org.gatein.registration.spi.ConsumerSPI;
import org.gatein.registration.spi.RegistrationSPI;
-import org.gatein.wsrp.jcr.mapping.Utils;
import org.gatein.wsrp.registration.JCRRegistrationPersistenceManager;
import javax.xml.namespace.QName;
@@ -148,7 +148,7 @@
Collection<PortletContextMapping> pcms = getPortletContexts();
for (PortletContextMapping pcm : pcms)
{
- PortletContext pc = PortletContext.createPortletContext(pcm.getId(),
Utils.safeGetBytes(pcm.getState()));
+ PortletContext pc = PortletContext.createPortletContext(pcm.getId(),
IOTools.safeGetBytes(pcm.getState()));
reg.addPortletContext(pc);
}
Modified: components/wsrp/trunk/pom.xml
===================================================================
--- components/wsrp/trunk/pom.xml 2011-03-17 20:24:57 UTC (rev 6084)
+++ components/wsrp/trunk/pom.xml 2011-03-17 20:42:23 UTC (rev 6085)
@@ -48,7 +48,7 @@
<properties>
<version.gatein.pc>2.3.0-Beta01</version.gatein.pc>
- <version.gatein.common>2.0.4-Beta02-SNAPSHOT</version.gatein.common>
+ <version.gatein.common>2.0.4-Beta02</version.gatein.common>
<version.gatein.wci>2.1.0-Beta01</version.gatein.wci>
<version.jsf>1.2_12</version.jsf>