org.apache.commons.modeler.mbeans

Class SimpleRemoteConnector


public class SimpleRemoteConnector
extends java.lang.Object

Based on jk2 proxy. Proxy using a very simple HTTP based protocol. For efficiency, it'll get bulk results and cache them - you can force an update by calling the refreshAttributes and refreshMetadata operations on this mbean. TODO: implement the user/pass auth ( right now you must use IP based security ) TODO: eventually support https TODO: support for metadata ( mbean-descriptors ) for description and type conversions TODO: filter out trivial components ( mutexes, etc )
Author:
Costin Manolache

Field Summary

(package private) String
domain
(package private) String
filter
(package private) long
lastRefresh
(package private) String
localDomain
private static Log
log
(package private) HashMap
mbeans
(package private) MBeanServer
mserver
(package private) String
pass
(package private) String
prefix
(package private) Registry
reg
(package private) String
statusPath
(package private) long
updateInterval
(package private) String
user
(package private) String
webServerHost
(package private) int
webServerPort

Constructor Summary

SimpleRemoteConnector()

Method Summary

void
destroy()
String
getDomain()
String
getFilter()
String
getPass()
String
getStatusPath()
protected InputStream
getStream(String qry)
connect to apache using http, get a list of mbeans.
long
getUpdateInterval()
String
getUser()
String
getWebServerHost()
int
getWebServerPort()
void
init()
Object
invoke(Object oname, String name, params[] , signature[] )
void
refresh()
Refresh the proxies, if updateInterval passed
void
refreshAttributes()
void
refreshMetadata()
void
setAttribute(ObjectName oname, Attribute attribute)
void
setDomain(String domain)
void
setFilter(String filter)
void
setPass(String pass)
void
setStatusPath(String statusPath)
void
setUpdateInterval(long updateInterval)
void
setUser(String user)
void
setWebServerHost(String webServerHost)
void
setWebServerPort(int webServerPort)
void
start()

Field Details

domain

(package private)  String domain

filter

(package private)  String filter

lastRefresh

(package private)  long lastRefresh

localDomain

(package private)  String localDomain

log

private static Log log

mbeans

(package private)  HashMap mbeans

mserver

(package private)  MBeanServer mserver

pass

(package private)  String pass

prefix

(package private)  String prefix

reg

(package private)  Registry reg

statusPath

(package private)  String statusPath

updateInterval

(package private)  long updateInterval

user

(package private)  String user

webServerHost

(package private)  String webServerHost

webServerPort

(package private)  int webServerPort

Constructor Details

SimpleRemoteConnector

public SimpleRemoteConnector()

Method Details

destroy

public void destroy()

getDomain

public String getDomain()

getFilter

public String getFilter()

getPass

public String getPass()

getStatusPath

public String getStatusPath()

getStream

protected InputStream getStream(String qry)
            throws Exception
connect to apache using http, get a list of mbeans. Can be overriten to support different protocols ( jk/Unix domain sockets, etc )

getUpdateInterval

public long getUpdateInterval()

getUser

public String getUser()

getWebServerHost

public String getWebServerHost()

getWebServerPort

public int getWebServerPort()

init

public void init()
            throws IOException

invoke

public Object invoke(Object oname,
                     String name,
                     params[] ,
                     signature[] )
            throws MBeanException,
                   ReflectionException

refresh

public void refresh()
Refresh the proxies, if updateInterval passed

refreshAttributes

public void refreshAttributes()

refreshMetadata

public void refreshMetadata()

setAttribute

public void setAttribute(ObjectName oname,
                         Attribute attribute)
            throws AttributeNotFoundException,
                   MBeanException,
                   ReflectionException

setDomain

public void setDomain(String domain)

setFilter

public void setFilter(String filter)

setPass

public void setPass(String pass)

setStatusPath

public void setStatusPath(String statusPath)

setUpdateInterval

public void setUpdateInterval(long updateInterval)

setUser

public void setUser(String user)

setWebServerHost

public void setWebServerHost(String webServerHost)

setWebServerPort

public void setWebServerPort(int webServerPort)

start

public void start()
            throws IOException

Copyright (c) 2001-2003 - Apache Software Foundation