Author: chris.laprun(a)jboss.com
Date: 2010-01-10 17:32:52 -0500 (Sun, 10 Jan 2010)
New Revision: 1214
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/EndpointInfoMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java
Log:
- Reuse ProducerInfo provided EndpointConfigurationInfo and RegistrationInfo in
EndpointInfoMapping and RegistrationInfoMapping
to avoid creating useless objects and make sure that the ones that are created are
properly configured.
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/EndpointInfoMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/EndpointInfoMapping.java 2010-01-10
22:27:03 UTC (rev 1213)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/EndpointInfoMapping.java 2010-01-10
22:32:52 UTC (rev 1214)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, 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.
@@ -46,10 +46,9 @@
setWSDLURL(info.getWsdlDefinitionURL());
}
- public EndpointConfigurationInfo toEndpointConfigurationInfo()
+ EndpointConfigurationInfo toEndpointConfigurationInfo(EndpointConfigurationInfo
initial)
{
- EndpointConfigurationInfo info = new EndpointConfigurationInfo();
- info.setWsdlDefinitionURL(getWSDLURL());
- return info;
+ initial.setWsdlDefinitionURL(getWSDLURL());
+ return initial;
}
}
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java 2010-01-10
22:27:03 UTC (rev 1213)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java 2010-01-10
22:32:52 UTC (rev 1214)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, 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.
@@ -26,8 +26,8 @@
import org.chromattic.api.annotations.DefaultValue;
import org.chromattic.api.annotations.Id;
import org.chromattic.api.annotations.MappedBy;
+import org.chromattic.api.annotations.OneToOne;
import org.chromattic.api.annotations.PrimaryType;
-import org.chromattic.api.annotations.OneToOne;
import org.chromattic.api.annotations.Property;
import org.gatein.wsrp.consumer.EndpointConfigurationInfo;
import org.gatein.wsrp.consumer.ProducerInfo;
@@ -100,11 +100,11 @@
info.setExpirationCacheSeconds(getExpirationCacheSeconds());
// endpoint
- EndpointConfigurationInfo endInfo =
getEndpointInfo().toEndpointConfigurationInfo();
+ EndpointConfigurationInfo endInfo =
getEndpointInfo().toEndpointConfigurationInfo(info.getEndpointConfigurationInfo());
info.setEndpointConfigurationInfo(endInfo);
// registration
- RegistrationInfo regInfo = getRegistrationInfo().toRegistrationInfo();
+ RegistrationInfo regInfo =
getRegistrationInfo().toRegistrationInfo(info.getRegistrationInfo());
info.setRegistrationInfo(regInfo);
return info;
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java 2010-01-10
22:27:03 UTC (rev 1213)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java 2010-01-10
22:32:52 UTC (rev 1214)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, 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.
@@ -25,8 +25,8 @@
import org.chromattic.api.annotations.Create;
import org.chromattic.api.annotations.FormattedBy;
-import org.chromattic.api.annotations.PrimaryType;
import org.chromattic.api.annotations.OneToMany;
+import org.chromattic.api.annotations.PrimaryType;
import org.chromattic.api.annotations.Property;
import org.exoplatform.commons.utils.Safe;
import org.gatein.portal.wsrp.state.JCRPersister;
@@ -95,18 +95,16 @@
}
}
- public RegistrationInfo toRegistrationInfo()
+ RegistrationInfo toRegistrationInfo(RegistrationInfo initial)
{
- RegistrationInfo regInfo = new RegistrationInfo();
+ initial.setConsumerName(getConsumerName());
+ initial.setRegistrationHandle(getRegistrationHandle());
+ initial.setRegistrationState(Safe.getBytes(getRegistrationState()));
- regInfo.setConsumerName(getConsumerName());
- regInfo.setRegistrationHandle(getRegistrationHandle());
- regInfo.setRegistrationState(Safe.getBytes(getRegistrationState()));
-
// registration properties
for (RegistrationPropertyMapping rpm : getRegistrationProperties())
{
- RegistrationProperty prop = regInfo.setRegistrationPropertyValue(rpm.getName(),
rpm.getValue());
+ RegistrationProperty prop = initial.setRegistrationPropertyValue(rpm.getName(),
rpm.getValue());
RegistrationPropertyDescriptionMapping rpdm = rpm.getDescription();
if (rpdm != null)
@@ -118,6 +116,6 @@
prop.setStatus(rpm.getStatus());
}
- return regInfo;
+ return initial;
}
}
Show replies by date