Skip to content

Commit

Permalink
add registration methods to jmx
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Oct 15, 2007
1 parent cfc79b4 commit 38eac37
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
@@ -1,7 +1,8 @@
/*
* SymmetricDS is an open source database synchronization solution.
*
* Copyright (C) Chris Henson <chenson42@users.sourceforge.net>
* Copyright (C) Chris Henson <chenson42@users.sourceforge.net>,
* Eric Long <erilong@users.sourceforge.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -32,6 +33,7 @@
import org.jumpmind.symmetric.service.IDataService;
import org.jumpmind.symmetric.service.INodeService;
import org.jumpmind.symmetric.service.IPurgeService;
import org.jumpmind.symmetric.service.IRegistrationService;
import org.springframework.jmx.export.annotation.ManagedAttribute;
import org.springframework.jmx.export.annotation.ManagedOperation;
import org.springframework.jmx.export.annotation.ManagedOperationParameter;
Expand All @@ -48,6 +50,8 @@ public class SymmetricManagementService {
private IPurgeService purgeService;

private INodeService nodeService;

private IRegistrationService registrationService;

private IDataService dataService;

Expand Down Expand Up @@ -117,6 +121,20 @@ public String reloadNode(String nodeId) {
return dataService.reloadNode(nodeId);
}

@ManagedOperation(description = "Re-Open registration for a specific node. If the node loses its registration, you can use this.")
@ManagedOperationParameters( { @ManagedOperationParameter(name = "nodeId", description = "The unique node ID for the node.") })
public void reOpenRegistration(String nodeId) {
registrationService.reOpenRegistration(nodeId);
}

@ManagedOperation(description = "Open registration for a node group for a specific external ID.")
@ManagedOperationParameters( {
@ManagedOperationParameter(name = "nodeGroup", description = "The node group where the registering node will be placed."),
@ManagedOperationParameter(name = "externalId", description = "The external ID that identifies the specific node.") })
public void openRegistration(String nodeGroup, String externalId) {
registrationService.openRegistration(nodeGroup, externalId);
}

public void setRuntimeConfiguration(IRuntimeConfig runtimeConfiguration) {
this.runtimeConfiguration = runtimeConfiguration;
}
Expand Down Expand Up @@ -144,4 +162,8 @@ public void setDataService(IDataService dataService) {
public void setNodeService(INodeService nodeService) {
this.nodeService = nodeService;
}

public void setRegistrationService(IRegistrationService registrationService) {
this.registrationService = registrationService;
}
}
1 change: 1 addition & 0 deletions symmetric/src/main/resources/symmetric-jmx.xml
Expand Up @@ -39,6 +39,7 @@
<property name="properties" ref="properties" />
<property name="dataSource" ref="dataSource" />
<property name="nodeService" ref="nodeService" />
<property name="registrationService" ref="registrationService" />
</bean>

</beans>

0 comments on commit 38eac37

Please sign in to comment.