Author: chris.laprun(a)jboss.com
Date: 2009-01-28 18:55:56 -0500 (Wed, 28 Jan 2009)
New Revision: 12692
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
Log:
- JBPORTAL-2284: Fixed error in eraseRegistrationInfo, removed checks for null
RegistrationInfo as it never is null now.
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2009-01-28
20:54:46 UTC (rev 12691)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2009-01-28
23:55:56 UTC (rev 12692)
@@ -177,10 +177,7 @@
public RegistrationInfo getRegistrationInfo()
{
// update parent since it might not be set when unfrozen from Hibernate
- if (persistentRegistrationInfo != null)
- {
- persistentRegistrationInfo.setParent(this);
- }
+ persistentRegistrationInfo.setParent(this);
return persistentRegistrationInfo;
}
@@ -191,35 +188,30 @@
public boolean isRegistered()
{
- if (persistentRegistrationInfo != null)
+ Boolean valid = persistentRegistrationInfo.isRegistrationValid();
+ if (valid == null)
{
- Boolean valid = persistentRegistrationInfo.isRegistrationValid();
- if (valid == null)
- {
- return persistentRegistrationInfo.getRegistrationHandle() != null;
- }
- else
- {
- return valid;
- }
+ return persistentRegistrationInfo.getRegistrationHandle() != null;
}
-
- return false;
+ else
+ {
+ return valid;
+ }
}
public boolean isRegistrationRequired()
{
- return persistentRegistrationInfo != null &&
persistentRegistrationInfo.isRegistrationDeterminedRequired();
+ return persistentRegistrationInfo.isRegistrationDeterminedRequired();
}
public boolean isRegistrationChecked()
{
- return persistentRegistrationInfo != null &&
persistentRegistrationInfo.isRegistrationRequired() != null;
+ return persistentRegistrationInfo.isRegistrationRequired() != null;
}
public boolean hasLocalRegistrationInfo()
{
- return persistentRegistrationInfo != null &&
persistentRegistrationInfo.hasLocalInfo();
+ return persistentRegistrationInfo.hasLocalInfo();
}
/**
@@ -251,7 +243,7 @@
public boolean isModifyRegistrationRequired()
{
- return isModifyRegistrationRequired || (persistentRegistrationInfo != null
&& persistentRegistrationInfo.isModifyRegistrationNeeded());
+ return isModifyRegistrationRequired ||
persistentRegistrationInfo.isModifyRegistrationNeeded();
}
// FIX-ME: remove when a better dirty management is in place at property level
@@ -346,8 +338,7 @@
try
{
// if we don't yet have registration information, get an unregistered
service description
- boolean unmanaged = persistentRegistrationInfo == null ||
persistentRegistrationInfo.isUndetermined();
- serviceDescription = getUnmanagedServiceDescription(unmanaged);
+ serviceDescription =
getUnmanagedServiceDescription(persistentRegistrationInfo.isUndetermined());
result.setServiceDescription(serviceDescription);
}
catch (OperationFailedFault operationFailedFault)
@@ -789,7 +780,7 @@
public RegistrationContext getRegistrationContext() throws PortletInvokerException
{
- if (persistentRegistrationInfo == null ||
persistentRegistrationInfo.isUndetermined())
+ if (persistentRegistrationInfo.isUndetermined())
{
refresh(false);
}
@@ -799,10 +790,7 @@
public void resetRegistration() throws PortletInvokerException
{
- if (persistentRegistrationInfo != null)
- {
- persistentRegistrationInfo.resetRegistration();
- }
+ persistentRegistrationInfo.resetRegistration();
invalidateCache();
registry.updateProducerInfo(this);
@@ -865,11 +853,6 @@
*/
private RefreshResult register(ServiceDescription serviceDescription, boolean
forceRefresh) throws PortletInvokerException
{
- if (persistentRegistrationInfo == null)
- {
- persistentRegistrationInfo = new RegistrationInfo(this);
- }
-
if (!isRegistered())
{
persistentEndpointInfo.refresh();
@@ -957,7 +940,7 @@
public void modifyRegistration() throws PortletInvokerException
{
- if (persistentRegistrationInfo != null &&
persistentRegistrationInfo.getRegistrationHandle() != null)
+ if (persistentRegistrationInfo.getRegistrationHandle() != null)
{
persistentEndpointInfo.refresh();
@@ -1009,11 +992,6 @@
private RefreshResult internalRefreshRegistration(ServiceDescription
serviceDescription, boolean mergeWithLocalInfo, boolean forceRefresh, boolean
forceCheckOfExtraProps) throws PortletInvokerException
{
- if (persistentRegistrationInfo == null)
- {
- persistentRegistrationInfo = new RegistrationInfo(this);
- }
-
RefreshResult result =
persistentRegistrationInfo.refresh(serviceDescription, persistentId,
mergeWithLocalInfo, forceRefresh, forceCheckOfExtraProps);
@@ -1025,7 +1003,6 @@
public boolean isRefreshNeeded(boolean considerCache)
{
boolean result = (considerCache && isCacheExpired())
- || persistentRegistrationInfo == null
|| persistentRegistrationInfo.isRefreshNeeded()
|| persistentEndpointInfo.isRefreshNeeded();
if (result)
@@ -1044,7 +1021,7 @@
public void eraseRegistrationInfo()
{
- persistentRegistrationInfo = null;
+ persistentRegistrationInfo =
RegistrationInfo.createUndeterminedRegistration(this);
registry.updateProducerInfo(this);
Show replies by date