Permalink
Browse files

ARQ-264 Added log output for distribution, notification, and app start

  • Loading branch information...
gpoul authored and aslakknutsen committed Mar 27, 2011
1 parent f4978db commit 225906db307bb33f7152b71f965647a4fbeb6b37
@@ -1,6 +1,8 @@
package org.jboss.arquillian.container.websphere.remote_7;
import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.management.Notification;
import javax.management.NotificationFilterSupport;
@@ -12,6 +14,7 @@
public class DeploymentNotificationListener implements NotificationListener
{
+ private static Logger log = Logger.getLogger(DeploymentNotificationListener.class.getName());
private AdminClient adminClient;
private NotificationFilterSupport filterSupport;
private ObjectName objectName;
@@ -35,6 +38,12 @@ public DeploymentNotificationListener(AdminClient adminClient, NotificationFilte
public void handleNotification(Notification notification, Object handback)
{
AppNotification appNotification = (AppNotification) notification.getUserData();
+ if (log.isLoggable(Level.FINEST)) {
+ log.finest("handleNotification message: " + appNotification.message);
+ log.finest("handleNotification taskName: " + appNotification.taskName);
+ log.finest("handleNotification taskStatus: " + appNotification.taskStatus);
+ log.finest("handleNotification eventProps: " + appNotification.props);
+ }
message = message += "\n" + appNotification.message;
if (
appNotification.taskName.equals(eventTypeToCheck) &&
@@ -21,6 +21,7 @@
import java.util.Hashtable;
import java.util.Locale;
import java.util.Properties;
+import java.util.logging.Logger;
import javax.jms.IllegalStateException;
import javax.management.MalformedObjectNameException;
@@ -60,6 +61,8 @@
// Instance Members -------------------------------------------------------------------||
//-------------------------------------------------------------------------------------||
+ private static Logger log = Logger.getLogger(WebSphereRemoteContainer.class.getName());
+
private WebSphereRemoteContainerConfiguration containerConfiguration;
private AdminClient adminClient;
@@ -96,6 +99,8 @@ public void start() throws LifecycleException
ObjectName serverMBean = adminClient.getServerMBean();
String processType = serverMBean.getKeyProperty("processType");
+ log.fine("CanonicalKeyPropertyListString: " + serverMBean.getCanonicalKeyPropertyListString());
+
if (processType.equals("DeploymentManager")
|| processType.equals("NodeAgent")
|| processType.equals("ManagedProcess"))
@@ -147,6 +152,8 @@ public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentExcept
String targetServer = "WebSphere:cell=" + serverMBean.getKeyProperty("cell")
+ ",node=" + serverMBean.getKeyProperty("node")
+ ",server=" + serverMBean.getKeyProperty("process");
+
+ log.info("Target server for deployment is " + targetServer);
module2Server.put("*",targetServer);
@@ -199,7 +206,8 @@ public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentExcept
if (checkCount < 300)
{
- appManagementProxy.startApplication(appName, null, null);
+ String targetsStarted = appManagementProxy.startApplication(appName, null, null);
+ log.info("Application was started on the following targets: " + targetsStarted);
} else {
throw new IllegalStateException("Distribution of application did not succeed to all nodes.");
}
@@ -238,12 +246,14 @@ private String checkDistributionStatus(DeploymentNotificationListener listener)
.getProperty(AppNotification.DISTRIBUTION_STATUS_COMPOSITE);
if (compositeStatus != null)
{
+ log.finer("compositeStatus: " + compositeStatus);
String[] serverStati = compositeStatus.split("\\+");
int countTrue = 0, countFalse = 0, countUnknown = 0;
for (String serverStatus : serverStati)
{
ObjectName objectName = new ObjectName(serverStatus);
distributionState = objectName.getKeyProperty("distribution");
+ log.finer("distributionState: " + distributionState);
if (distributionState.equals("true"))
countTrue++;
if (distributionState.equals("false"))

0 comments on commit 225906d

Please sign in to comment.