Author: chris.laprun(a)jboss.com
Date: 2011-10-17 13:12:19 -0400 (Mon, 17 Oct 2011)
New Revision: 7749
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationManagerImpl.java
Log:
- Extracted constant.
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationManagerImpl.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationManagerImpl.java 2011-10-17
11:33:38 UTC (rev 7748)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationManagerImpl.java 2011-10-17
17:12:19 UTC (rev 7749)
@@ -62,6 +62,7 @@
private RegistrationPolicy policy;
private RegistrationPersistenceManager persistenceManager;
private
AtomicReference<CopyOnWriteArrayList<RegistrationDestructionListener>>
listeners = new
AtomicReference<CopyOnWriteArrayList<RegistrationDestructionListener>>();
+ public static final String NON_REGISTERED_CONSUMER = "NONREGISTERED";
public RegistrationManagerImpl()
{
@@ -256,18 +257,16 @@
{
//TODO: this might be better to place somewhere else and use the
RegistrationHandler.register instead of
// doing basically the same thing below.
- String NonRegisteredConsumer = "NONREGISTERED";
- Consumer unregConsumer = getConsumerByIdentity(NonRegisteredConsumer);
+ Consumer unregConsumer = getConsumerByIdentity(NON_REGISTERED_CONSUMER);
if (unregConsumer == null)
{
- unregConsumer = createConsumer(NonRegisteredConsumer);
- Registration registration = addRegistrationTo(NonRegisteredConsumer, new
HashMap<QName, Object>(), null, false);
+ unregConsumer = createConsumer(NON_REGISTERED_CONSUMER);
+ Registration registration = addRegistrationTo(NON_REGISTERED_CONSUMER, new
HashMap<QName, Object>(), null, false);
registration.setStatus(RegistrationStatus.VALID);
getPersistenceManager().saveChangesTo(unregConsumer);
}
//The unregistered consumer should only ever have one registration, return that
- Registration registration = unregConsumer.getRegistrations().iterator().next();
- return registration;
+ return unregConsumer.getRegistrations().iterator().next();
}
public void removeRegistration(String registrationHandle) throws
RegistrationException, NoSuchRegistrationException
Show replies by date