Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cemartins/mqconsole
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: mq-console-2.0.6
Choose a base ref
...
head repository: cemartins/mqconsole
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 10 commits
  • 16 files changed
  • 1 contributor

Commits on Sep 1, 2015

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    eedf009 View commit details

Commits on Sep 2, 2015

  1. Copy the full SHA
    ef3a1b5 View commit details

Commits on Sep 4, 2015

  1. Copy the full SHA
    e828bc0 View commit details

Commits on Sep 7, 2015

  1. Copy the full SHA
    1124355 View commit details

Commits on Sep 16, 2015

  1. Copy the full SHA
    201fccc View commit details

Commits on Oct 23, 2015

  1. Copy the full SHA
    d7289b1 View commit details
  2. added travis configuration

    cemartins committed Oct 23, 2015
    Copy the full SHA
    db50e64 View commit details

Commits on Oct 24, 2015

  1. Update .travis.yml

    Fix syntax
    cemartins committed Oct 24, 2015
    Copy the full SHA
    22df04f View commit details

Commits on Oct 28, 2016

  1. Copy the full SHA
    88fa85a View commit details
  2. Copy the full SHA
    a411577 View commit details
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: java
jdk:
- oraclejdk8
os:
- linux
- osx
matrix:
allow_failures:
-os: linux
35 changes: 33 additions & 2 deletions mqc-activemq/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>net.sf.juffrou</groupId>
<artifactId>mq-console</artifactId>
<version>2.0.6</version>
<version>2.0.7-SNAPSHOT</version>
</parent>
<artifactId>mqc-activemq</artifactId>
<name>MQConsole for Apache ActiveMQ</name>
@@ -15,7 +15,7 @@
<dependency>
<groupId>net.sf.juffrou</groupId>
<artifactId>mqc-core</artifactId>
<version>2.0.6</version>
<version>2.0.7-SNAPSHOT</version>
</dependency>

<dependency>
@@ -177,6 +177,37 @@
<bundle.name>${project.build.finalName}-${project.version}.dmg</bundle.name>
</properties>
</profile>
<profile>
<id>Linux_specific_package</id>
<activation>
<os>
<family>unix</family>
<name>linux</name>
</os>
</activation>
<properties>
<bundle.name>${project.build.finalName}-${project.version}.zip</bundle.name>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>Linux_ZIP_package</id>
<phase>package</phase>
<goals> <goal>run</goal> </goals>
<configuration>
<target>
<zip destfile="${project.build.directory}/bundles/${bundle.name}" basedir="${project.build.directory}/bundles/${project.build.finalName}" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>Windows_specific_package</id>
<activation>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -107,6 +107,9 @@ public void sendMessage(MessageSendPresenter presenter, MessageDescriptor messag
// get the response in a different thread
responseReceivingThread.start();
}
else {
connection.close();
}

// display the updated Sent Message Descriptor on the presenter window
messageDescriptor.addHeader(HeaderDescriptor.HEADER_MESSAGE_ID, message.getJMSMessageID() == null ? ""
Original file line number Diff line number Diff line change
@@ -29,6 +29,8 @@
<!-- Activemq connection factory -->
<bean id="amqConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<constructor-arg index="0" value="tcp://${broker_hostname}:${broker_port}"/>
<property name="userName" value="${broker_username}" />
<property name="password" value="${broker_userpwd}" />
</bean>

<!-- ConnectionFactory Definition -->
4 changes: 2 additions & 2 deletions mqc-core/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>net.sf.juffrou</groupId>
<artifactId>mq-console</artifactId>
<version>2.0.6</version>
<version>2.0.7-SNAPSHOT</version>
</parent>
<artifactId>mqc-core</artifactId>
<name>MQConsole Core</name>
@@ -25,7 +25,7 @@
<dependency>
<groupId>org.fxmisc.richtext</groupId>
<artifactId>richtextfx</artifactId>
<version>0.6.6</version>
<version>0.6.10</version>
</dependency>

<!-- SPRING -->
58 changes: 9 additions & 49 deletions mqc-core/src/main/java/net/sf/juffrou/mq/MQConsole.java
Original file line number Diff line number Diff line change
@@ -13,8 +13,6 @@
import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.concurrent.Task;
import javafx.concurrent.Worker;
import javafx.event.EventHandler;
@@ -61,6 +59,10 @@ public class MQConsole extends Application implements ConsolePreloader.SharedSce
if (System.getProperty("os.name").startsWith("Mac"))
System.setProperty("mq.console.log.dir", System.getProperty("user.home")
+ "/Library/Application Support/MQConsole");
else
if (System.getProperty("os.name").toLowerCase().equals("linux"))
System.setProperty("mq.console.log.dir", System.getProperty("user.home")
+ "/var/log/MQConsole");
else
System.setProperty("mq.console.log.dir", System.getenv("APPDATA") + "/MQConsole");
}
@@ -78,11 +80,15 @@ public static void main(String[] args) {
}

private static void setMQConsoleDir() {
String mqConsoleDir = System.getProperty("user.dir") + File.separator;
String mqConsoleDir = System.getProperty("user.dir") + File.separator;
if (System.getProperty("os.name").startsWith("Mac")) {
URL mySource = MQConsole.class.getProtectionDomain().getCodeSource().getLocation();
mqConsoleDir = mySource.getPath().substring(0, mySource.getPath().lastIndexOf('/'));
}
else if (System.getProperty("os.name").toLowerCase().equals("linux")) {
URL mySource = MQConsole.class.getProtectionDomain().getCodeSource().getLocation();
mqConsoleDir = mySource.getPath().substring(0, mySource.getPath().lastIndexOf('/'));
}
System.setProperty("mq.console.dir", mqConsoleDir);
}

@@ -120,52 +126,6 @@ public void init() {

}

@SuppressWarnings("restriction")
public void old_start(Stage primaryStage) throws Exception {
try {

applicationContext = new ClassPathXmlApplicationContext(new String[] { "classpath*:context/*-context.xml" });

QueuesListView queuesListView = applicationContext.getBean(QueuesListView.class);
parentNode = queuesListView.getView();
mainController = (QueuesListPresenter) queuesListView.getPresenter();
mainController.setStage(primaryStage);
Scene scene = new Scene(parentNode, 326, 73);
primaryStage.setScene(scene);
primaryStage.setTitle("MQ Queues");

// Terminate application upon main window closing
primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {

@Override
public void handle(WindowEvent arg0) {
Platform.exit();
System.exit(0);
}

});
}
catch (Exception e) {

if (log.isErrorEnabled()) {
log.error("MQConsole Cannot Start", e);
}

ExceptionDialog alert = new ExceptionDialog();
alert.setTitle("Error Dialog");
alert.setHeaderText("MQConsole Cannot Start");
alert.setContentText(e.getMessage());
alert.setException(e);
alert.showAndWait();

Platform.exit();
System.exit(1);
}

primaryStage.show();
}


@Override
public void start(final Stage initStage) throws Exception {
final Task<QueuesListView> friendTask = new Task<QueuesListView>() {
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package net.sf.juffrou.mq.messages;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
@@ -9,9 +15,6 @@
import net.sf.juffrou.mq.messages.task.MessageListenerTaskFactory;
import net.sf.juffrou.mq.util.MessageReceivedHandler;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class MessageListenerImpl implements MessageListener {

@@ -22,22 +25,22 @@ public class MessageListenerImpl implements MessageListener {
private MessageViewView messageViewView;

private AbstractMessageListenerTask currentListeningTask;
private Thread currentListeningThread = null;
private ExecutorService currentListeningThread = null;
private String currentListeningQueue;

public void startMessageListener(Stage parentStage, String listeningQueue) {

if (currentListeningThread != null) {
currentListeningTask.cancel(true);
currentListeningThread.interrupt(); // cannot have more than one active listener
currentListeningThread.shutdownNow(); // cannot have more than one active listener
}

IncomingMessageHandler handler = new IncomingMessageHandler(parentStage, listeningQueue);
currentListeningTask = messageListenerTaskFactory.createMessageListenerTask(handler, listeningQueue);

currentListeningQueue = listeningQueue;
currentListeningThread = new Thread(currentListeningTask, "Message listening task");
currentListeningThread.start();
currentListeningThread = Executors.newSingleThreadExecutor();//new Thread(currentListeningTask, "Message listening task");
currentListeningThread.execute(currentListeningTask);
}

public boolean isCurrentListeningQueue(String listeningQueue) {
@@ -47,7 +50,7 @@ public boolean isCurrentListeningQueue(String listeningQueue) {
public void stopMessageListener() {
if (currentListeningThread != null) {
currentListeningTask.cancel(true);
currentListeningThread.interrupt(); // cannot have more than one active listener
currentListeningThread.shutdownNow(); // cannot have more than one active listener
}

currentListeningQueue = null;
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package net.sf.juffrou.mq.messages.presenter;

import java.util.Iterator;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
@@ -34,6 +37,7 @@
import javafx.scene.control.TitledPane;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import javafx.util.Callback;
import net.sf.juffrou.mq.dom.HeaderDescriptor;
import net.sf.juffrou.mq.dom.MessageDescriptor;
@@ -45,7 +49,7 @@

@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class MessageSendPresenter {
public class MessageSendPresenter implements DisposableBean {

protected static final Logger LOG = LoggerFactory.getLogger(MessageSendPresenter.class);

@@ -104,6 +108,7 @@ public class MessageSendPresenter {

private QueueDescriptor queueNameSend;

private ExecutorService executor = null; // Executor service for XML Viewer
private XmlViewer requestXmlViewer;
private XmlViewer responseXmlViewer;

@@ -214,9 +219,11 @@ public ListCell<QueueDescriptor> call(ListView<QueueDescriptor> arg0) {

messageAccordionReceive.setExpandedPane(receivePayloadPane);

if(executor == null)
executor = Executors.newSingleThreadExecutor();

// Prepare the request payload
requestXmlViewer = new XmlViewer();
requestXmlViewer = new XmlViewer(executor);

requestPayloadAnchorPane.getStylesheets().add(XmlViewer.class.getResource("xml-highlighting.css").toExternalForm());
requestPayloadAnchorPane.getChildren().add(requestXmlViewer);
@@ -226,7 +233,7 @@ public ListCell<QueueDescriptor> call(ListView<QueueDescriptor> arg0) {
requestPayloadAnchorPane.setRightAnchor(requestXmlViewer, 0.0);

// Prepare the response payload
responseXmlViewer = new XmlViewer();
responseXmlViewer = new XmlViewer(executor);
responseXmlViewer.setEditable(false);

responsePayloadAnchorPane.getStylesheets().add(XmlViewer.class.getResource("xml-highlighting.css").toExternalForm());
@@ -235,6 +242,22 @@ public ListCell<QueueDescriptor> call(ListView<QueueDescriptor> arg0) {
responsePayloadAnchorPane.setBottomAnchor(responseXmlViewer, 0.0);
responsePayloadAnchorPane.setLeftAnchor(responseXmlViewer, 0.0);
responsePayloadAnchorPane.setRightAnchor(responseXmlViewer, 0.0);


// set the disposable bean
/*
responsePayloadAnchorPane.getScene().getWindow().setOnCloseRequest( new EventHandler<WindowEvent>() {
@Override
public void handle(WindowEvent event) {
try {
destroy();
} catch (Exception e) {
e.printStackTrace();
}
}
});
*/
}

private static class QueueDescriptorCell extends ListCell<QueueDescriptor> {
@@ -322,5 +345,11 @@ public void displayMessageReceived(MessageDescriptor messageDescriptor) {
public Stage getStage() {
return (Stage) messageAccordionSend.getScene().getWindow();
}

@Override
public void destroy() throws Exception {
executor.shutdownNow();
executor = null;
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package net.sf.juffrou.mq.messages.presenter;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@@ -21,7 +25,7 @@

@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class MessageViewPresenter implements MessageViewController {
public class MessageViewPresenter implements MessageViewController, DisposableBean {

private static final String SCRIPT_SET_TEXT_PREFIX = "editor.setValue(\"";
private static final String SCRIPT_SET_TEXT_SUFFIX = "\");";
@@ -38,6 +42,8 @@ public class MessageViewPresenter implements MessageViewController {
@FXML
private AnchorPane payloadAnchorPane;

private ExecutorService executor = null; // Executor service for XML Viewer

private MessageDescriptor messageDescriptor;

public MessageDescriptor getMessageDescriptor() {
@@ -62,7 +68,10 @@ public void initialize() {

messageAccordion.setExpandedPane(payloadPane);

XmlViewer xmlViewer = new XmlViewer();
if(executor == null)
executor = Executors.newSingleThreadExecutor();

XmlViewer xmlViewer = new XmlViewer(executor);
xmlViewer.setEditable(false);


@@ -88,4 +97,10 @@ public void initialize() {

}

@Override
public void destroy() throws Exception {
executor.shutdownNow();
executor = null;
}

}
Loading