Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #102 from jbertram/HORNETQ-911_EAP
Browse files Browse the repository at this point in the history
[HORNETQ-911] IllegalStateException: Cannot access JMS Server, core server is not yet active during shutting down of backup server
  • Loading branch information
clebertsuconic committed Apr 20, 2012
2 parents 8bc3333 + 2a2fbb8 commit 87954b2
Showing 1 changed file with 52 additions and 25 deletions.
77 changes: 52 additions & 25 deletions src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
Expand Up @@ -724,20 +724,28 @@ public boolean removeQueueFromJNDI(String name, String jndi) throws Exception
/* (non-Javadoc)
* @see org.hornetq.jms.server.JMSServerManager#removeQueueFromJNDI(java.lang.String, java.lang.String)
*/

public boolean removeQueueFromJNDI(String name) throws Exception
public boolean removeQueueFromJNDI(final String name) throws Exception
{
checkInitialised();

if (removeFromJNDI(queues, queueJNDI, name))
{
storage.deleteDestination(PersistedType.Queue, name);
return true;
}
else
// HORNETQ-911 - make this runAfterActive to prevent WARN messages on shutdown/undeployment when the backup was never activated
runAfterActive(new RunnableException()
{
return false;
}
public String toString()
{
return "removeQueueFromJNDI for " + name;
}

public void runException() throws Exception
{
checkInitialised();

if (removeFromJNDI(queues, queueJNDI, name))
{
storage.deleteDestination(PersistedType.Queue, name);
}
}
});

return true;
}

/* (non-Javadoc)
Expand All @@ -762,19 +770,28 @@ public boolean removeTopicFromJNDI(String name, String jndi) throws Exception
/* (non-Javadoc)
* @see org.hornetq.jms.server.JMSServerManager#removeTopicFromJNDI(java.lang.String, java.lang.String)
*/

public boolean removeTopicFromJNDI(String name) throws Exception
public boolean removeTopicFromJNDI(final String name) throws Exception
{
checkInitialised();
// HORNETQ-911 - make this runAfterActive to prevent WARN messages on shutdown/undeployment when the backup was never activated
runAfterActive(new RunnableException()
{
public String toString()
{
return "removeTopicFromJNDI for " + name;
}

boolean removed = removeFromJNDI(topics, topicJNDI, name);
public void runException() throws Exception
{
checkInitialised();

if (removed)
{
storage.deleteDestination(PersistedType.Topic, name);
}
if (removeFromJNDI(topics, topicJNDI, name))
{
storage.deleteDestination(PersistedType.Queue, name);
}
}
});

return removed;
return true;
}

/* (non-Javadoc)
Expand Down Expand Up @@ -1331,12 +1348,22 @@ protected HornetQConnectionFactory internalCreateCFPOJO(final ConnectionFactoryC

public synchronized boolean destroyConnectionFactory(final String name) throws Exception
{
if (!shutdownConnectionFactory(name))
// HORNETQ-911 - make this runAfterActive to prevent WARN messages on shutdown/undeployment when the backup was never activated
runAfterActive(new RunnableException()
{
return false;
}

storage.deleteConnectionFactory(name);
public String toString()
{
return "destroyConnectionFactory for " + name;
}

public void runException() throws Exception
{
shutdownConnectionFactory(name);

storage.deleteConnectionFactory(name);
}
});

return true;
}
Expand Down

0 comments on commit 87954b2

Please sign in to comment.