Skip to content

Commit

Permalink
#786: Quartz plugin. Work in progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
davsclaus committed Dec 27, 2013
1 parent 125a1c5 commit 9cfb629
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hawtio-web/src/main/webapp/app/quartz/html/schedulers.html
@@ -1,6 +1,6 @@
<div ng-controller="Quartz.QuartzController">

<div class="span12 well" ng-hide="selectedScheduler">
<div class="span12 well" ng-hide="selectedSchedulerMBean">
<form>
<p>The Quartz plugin allows you to see details about running Quartz Schedulers, and their associated triggers and
jobs.</p>
Expand All @@ -9,7 +9,7 @@
</form>
</div>

<div ng-show="selectedScheduler" class="row-fluid">
<div ng-show="selectedSchedulerMBean" class="row-fluid">
<div class="alert alert-info">
<button class="close" data-dismiss="alert">×</button>

Expand Down
11 changes: 10 additions & 1 deletion hawtio-web/src/main/webapp/app/quartz/js/quartz.ts
Expand Up @@ -107,6 +107,13 @@ module Quartz {
log.debug("Selected scheduler mbean " + $scope.selectedScheduler);
var obj = response.value;
if (obj) {

// did we change scheduler
var newScheduler = $scope.selectedScheduler !== obj;
if (newScheduler) {
$scope.triggers = [];
}

$scope.selectedScheduler = obj;
$scope.selectedSchedulerIcon = Quartz.iconClass(obj.Started);

Expand Down Expand Up @@ -163,6 +170,7 @@ module Quartz {
});
}

log.info("Core apply in render quartz")
Core.$apply($scope);
}

Expand Down Expand Up @@ -226,6 +234,7 @@ module Quartz {
selectionChanged(data);
Core.$apply($scope);
});

// lets do this asynchronously to avoid Error: $digest already in progress
setTimeout(updateSelectionFromURL, 50);
}
Expand All @@ -247,7 +256,7 @@ module Quartz {

function selectionChanged(data) {
var selectionKey = data ? data.objectName : null;
log.debug("Selection is now: " + selectionKey);
log.info("Selection is now: " + selectionKey);

if (selectionKey) {
// if we selected a scheduler then register a callback to get its trigger data updated in-real-time
Expand Down
12 changes: 11 additions & 1 deletion hawtio-web/src/test/resources/applicationContext.xml
Expand Up @@ -176,19 +176,29 @@
</route>

<route id="quartzRoute2">
<!-- must set -1 due bug in camel-quarz2 -->
<from uri="quartz2:mygroup/myothertimer?cron=0/2+*+*+*+*+?"/>
<log message="Quartz2 myothertrigger fired"/>
</route>
</camelContext>

<camelContext id="otherQuartzCamel" xmlns="http://camel.apache.org/schema/spring">
<route id="otherQuartzRoute">
<from uri="quartz2other:foo/bar?cron=0/8+*+*+*+*+?"/>
<log message="Other Quartz2 foo/bar fired"/>
</route>
</camelContext>

<!-- dummy bean for camel routes -->
<bean id="myBean" class="io.hawt.camel.sample.CheeseBean"/>

<bean id="quartz2" class="org.apache.camel.component.quartz2.QuartzComponent">
<property name="propertiesFile" value="myquartz.properties"/>
</bean>

<bean id="quartz2other" class="org.apache.camel.component.quartz2.QuartzComponent">
<property name="propertiesFile" value="myotherquartz.properties"/>
</bean>

<!-- infinispan demo -->
<bean id="infinispanFactory" class="io.hawt.example.infinispan.InfinispanDemo" init-method="init" lazy-init="false"/>
</beans>
11 changes: 11 additions & 0 deletions hawtio-web/src/test/resources/myotherquartz.properties
@@ -0,0 +1,11 @@
#org.quartz.scheduler.instanceName = MyScheduler
#org.quartz.scheduler.instanceId = 2
#org.quartz.scheduler.rmi.export = false
#org.quartz.scheduler.rmi.proxy = false

org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 5

org.quartz.scheduler.jmx.export=true

org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore

0 comments on commit 9cfb629

Please sign in to comment.