org.apache.commons.modeler.mbeans

Class SimpleRemoteConnector

public class SimpleRemoteConnector extends 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
Stringdomain
Stringfilter
longlastRefresh
StringlocalDomain
static Loglog
HashMapmbeans
MBeanServermserver
Stringpass
Stringprefix
Registryreg
StringstatusPath
longupdateInterval
Stringuser
StringwebServerHost
intwebServerPort
Constructor Summary
SimpleRemoteConnector()
Method Summary
voiddestroy()
StringgetDomain()
StringgetFilter()
StringgetPass()
StringgetStatusPath()
protected InputStreamgetStream(String qry)
connect to apache using http, get a list of mbeans.
longgetUpdateInterval()
StringgetUser()
StringgetWebServerHost()
intgetWebServerPort()
voidinit()
Objectinvoke(Object oname, String name, Object[] params, String[] signature)
voidrefresh()
Refresh the proxies, if updateInterval passed
voidrefreshAttributes()
voidrefreshMetadata()
voidsetAttribute(ObjectName oname, Attribute attribute)
voidsetDomain(String domain)
voidsetFilter(String filter)
voidsetPass(String pass)
voidsetStatusPath(String statusPath)
voidsetUpdateInterval(long updateInterval)
voidsetUser(String user)
voidsetWebServerHost(String webServerHost)
voidsetWebServerPort(int webServerPort)
voidstart()

Field Detail

domain

String domain

filter

String filter

lastRefresh

long lastRefresh

localDomain

String localDomain

log

private static Log log

mbeans

HashMap mbeans

mserver

MBeanServer mserver

pass

String pass

prefix

String prefix

reg

Registry reg

statusPath

String statusPath

updateInterval

long updateInterval

user

String user

webServerHost

String webServerHost

webServerPort

int webServerPort

Constructor Detail

SimpleRemoteConnector

public SimpleRemoteConnector()

Method Detail

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)
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()

invoke

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

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)

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()
Copyright (c) 2001-2003 - Apache Software Foundation