Share

Heritrix: Internet Archive Web Crawler

Tracker: Feature Requests

8 Add destroy to JMX API - ID: 1358617
Last Update: Comment added ( karl-ia )

Archiveit can start new heritrix instances but also
needs to be able to destroy heritrix instances. High
priority 'cos archiveit wants it.

Below adds the destroy method to JMX:

* src/java/org/archive/crawler/Heritrix.java
===================================================================
RCS file:
/cvsroot/archive-crawler/ArchiveOpenCrawler/src/java/org/archive/crawler/He
ritrix.java,v
retrieving revision 1.122
diff -u -r1.122 Heritrix.java
--- src/java/org/archive/crawler/Heritrix.java 17 Nov
2005 00:55:56 -0000 1.122
+++ src/java/org/archive/crawler/Heritrix.java 17 Nov
2005 01:41:52 -0000
@@ -280,6 +280,7 @@

private final static String START_OPER = "start";
private final static String STOP_OPER = "stop";
+ private final static String DESTROY_OPER = "destroy";
private final static String INTERRUPT_OPER =
"interrupt";
private final static String START_CRAWLING_OPER =
"startCrawling";
private final static String STOP_CRAWLING_OPER =
"stopCrawling";
@@ -299,7 +300,7 @@
ADD_CRAWL_JOB_OPER,
ADD_CRAWL_JOB_BASEDON_OPER,
DELETE_CRAWL_JOB_OPER, ALERT_OPER,
PENDING_JOBS_OPER,
COMPLETED_JOBS_OPER, CRAWLEND_REPORT_OPER,
SHUTDOWN_OPER,
- LOG_OPER});
+ LOG_OPER, DESTROY_OPER});
}
private CompositeType jobCompositeType = null;
private TabularType jobsTabularType = null;
@@ -1904,6 +1905,10 @@
operations[13] = new
OpenMBeanOperationInfoSupport(Heritrix.LOG_OPER,
"Add a log message", args, SimpleType.VOID,
MBeanOperationInfo.ACTION);
+
+ operations[14] = new
OpenMBeanOperationInfoSupport(
+ Heritrix.DESTROY_OPER, "Destroy Heritrix
instance", null,
+ SimpleType.VOID,
MBeanOperationInfo.ACTION);

// Build the info object.
return new
OpenMBeanInfoSupport(this.getClass().getName(),
@@ -1990,6 +1995,11 @@
stop();
return null;
}
+ if (operationName.equals(DESTROY_OPER)) {
+ JmxUtils.checkParamsCount(DESTROY_OPER,
params, 0);
+ destroy();
+ return null;
+ }
if (operationName.equals(SHUTDOWN_OPER)) {
JmxUtils.checkParamsCount(SHUTDOWN_OPER,
params, 0);
Heritrix.shutdown();


Michael Stack ( stack-sf ) - 2005-11-17 01:45

8

Closed

None

Karl Thiessen

None

1.8.0

Public


Comments ( 4 )

Date: 2007-03-14 01:44
Sender: karl-ia


This issue is now discussed in the new JIRA tracker at
http://webteam.archive.org/jira/browse/HER-980 -- please add further
comments at that location.


Date: 2006-04-12 22:52
Sender: karl-ia

Logged In: YES
user_id=1269624

Verified in Archive-It production. Thanks, Michael.


Date: 2005-12-02 23:22
Sender: stack-sfProject Admin

Logged In: YES
user_id=924942

Committed. Message below. Assigning Karl to test/verify.
Assigned to new 1.8.0 category.

TO TEST:

Previous to commit -- i.e. 1.6.0 Heritrix-- there was no
CawlService#destroy JMX operation. Now there is. To test,
create instances vi the cmdline-jmxclient and then destroy
them using new method (Watch them come and go in jconsole or
with the local-instances.jsp page in Heritrix UI).


Implement '[ 1358617 ] Add destroy to JMX API'

* src/java/org/archive/crawler/Heritrix.java
Add CrawlService#destroy JMX operation to call Heritrix
instance destroy method
(Previously, no means of destroying a Heritrix instance
via JMX).



Date: 2005-12-02 19:37
Sender: stack-sfProject Admin

Logged In: YES
user_id=924942

Committed. Message below. Assigning Karl to test/verify.
Assigned to new 1.8.0 category.

TO TEST:

Previous to commit -- i.e. 1.6.0 Heritrix-- there was no
CawlService#destroy JMX operation. Now there is. To test,
create instances vi the cmdline-jmxclient and then destroy
them using new method (Watch them come and go in jconsole or
with the local-instances.jsp page in Heritrix UI).


Implement '[ 1358617 ] Add destroy to JMX API'

* src/java/org/archive/crawler/Heritrix.java
Add CrawlService#destroy JMX operation to call Heritrix
instance destroy method
(Previously, no means of destroying a Heritrix instance
via JMX).



Attached File ( 1 )

Filename Description Download
diff.txt Download

Changes ( 5 )

Field Old Value Date By
status_id Open 2006-04-12 22:52 karl-ia
close_date - 2006-04-12 22:52 karl-ia
artifact_group_id None 2005-12-02 19:37 stack-sf
assigned_to stack-sf 2005-12-02 19:37 stack-sf
File Added 156562: diff.txt 2005-11-17 01:45 stack-sf