/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* See LICENSE.txt included in this distribution for the specific
* language governing permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at LICENSE.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/**
* Class to handle the connection and methods to the OpenGrok Agent
* @author Jan S Berg
*/
private boolean connected = false;
private boolean listenerRegistered = false;
/** MAX size of the filesInfo buffer */
/**
* Constructor for AgentConnection to OpenGrok JMX Agent
* @param url The JMX url for the agent to connect to
* @throws java.net.MalformedURLException if url is not in correct format
* @throws java.io.IOException if a connection error occurs
* @throws javax.management.MalformedObjectNameException if the JMX object name is not correct
*/
public AgentConnection(String url) throws MalformedURLException, IOException, MalformedObjectNameException {
}
if (!isConnected()) {
try {
reconnect(1);
} catch (IOException ex) {
}
}
return server;
}
return agenturl;
}
}
}
public void clearFilesInfo() {
filesInfo = new StringBuilder();
}
public long getStartTime() {
return starttime;
}
public long getEndTime() {
return endtime;
}
}
} else if (handback instanceof ObjectName) {
}
} else if (handback instanceof ObjectName) {
}
} else if (handback instanceof ObjectName) {
} else {
}
}
} else {
}
}
//filesInfo.append(notification.getMessage());
if (actionListener != null) {
actionListener.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "OpenGrok fileevent"));
}
}
}
listenerRegistered = true;
}
boolean notconnected = true;
int triednumtimes = 0;
while (notconnected) {
try {
}
}
try {
connect();
notconnected = false;
} catch (MalformedURLException ex) {
throw ex;
} catch (IOException ex) {
notconnected = true;
if (triednumtimes <= retrytimes) {
" next try.");
try {
}
} else {
throw ex;
}
}
}
}
connected = true;
}
public boolean isConnected() {
return connected;
}
public void unregister() {
try {
listenerRegistered = false;
logger.warning("Exception unregister notif listener " + this.getClass().getName() + " for ObjectName " + objName);
}
}
try {
}
} catch (Exception e) {
}
}
}