Documentation ¶
Index ¶
- Constants
- func Close(env *jnigi.Env, connection *jnigi.ObjectRef)
- type BeanExecutor
- type Client
- func (mbean *Client) Execute(operation Operation) (string, error)
- func (mbean *Client) Get(domainName string, beanName string, attributeName string, args OperationArgs) (string, error)
- func (mbean *Client) GetEnv() *jnigi.Env
- func (mbean *Client) OpenConnection(jndiURI string) (*jnigi.ObjectRef, error)
- func (mbean *Client) Put(domainName string, beanName string, attributeName string, args OperationArgs) (string, error)
- func (mbean *Client) RegisterClassHandler(typeName string, handler extensions.IHandler) error
- func (mbean *Client) RegisterInterfaceHandler(typeName string, handler extensions.InterfaceHandler) error
- func (mbean *Client) WithEnvironment(env *jnigi.Env) BeanExecutor
- type MockBeanExecutor
- func (_m *MockBeanExecutor) Execute(operation Operation) (string, error)
- func (_m *MockBeanExecutor) Get(domainName string, beanName string, attributeName string, args OperationArgs) (string, error)
- func (_m *MockBeanExecutor) GetEnv() *jnigi.Env
- func (_m *MockBeanExecutor) OpenConnection(jndiURI string) (*jnigi.ObjectRef, error)
- func (_m *MockBeanExecutor) Put(domainName string, beanName string, attributeName string, args OperationArgs) (string, error)
- func (_m *MockBeanExecutor) RegisterClassHandler(typeName string, handler extensions.IHandler) error
- func (_m *MockBeanExecutor) RegisterInterfaceHandler(typeName string, handler extensions.InterfaceHandler) error
- func (_m *MockBeanExecutor) WithEnvironment(env *jnigi.Env) BeanExecutor
- type Operation
- type OperationArgs
Constants ¶
const ( STRING = "java/lang/String" OBJECT = "java/lang/Object" FLOAT = "java/lang/Float" )
a collection of JNI representations of java primitive types these will be the boxed representations, not the true primitive
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BeanExecutor ¶
type BeanExecutor interface { RegisterClassHandler(typeName string, handler extensions.IHandler) error RegisterInterfaceHandler(typeName string, handler extensions.InterfaceHandler) error Execute(operation Operation) (string, error) Get(domainName string, beanName string, attributeName string, args OperationArgs) (string, error) Put(domainName string, beanName string, attributeName string, args OperationArgs) (string, error) WithEnvironment(env *jnigi.Env) BeanExecutor GetEnv() *jnigi.Env OpenConnection(jndiURI string) (*jnigi.ObjectRef, error) }
BeanExecutor is the interface used around this package. This is how an execution is performed. This will always rely on the MBean Client's environment Close will handle any types of cleanup that is related directly to MBean operations
for example: cleaning up the JMX connection and deleting the reference
type Client ¶
type Client struct { JmxURI string Env *jnigi.Env ClassHandlers sync.Map InterfaceHandlers sync.Map }
Client is the overarching type that will facilitate JMX connections JmxConnection is the living connection that was created when `CreateMBeanConnection` was called to create the Client Env is the environment that belongs to this bean, this will not always match the JVM env!
func (*Client) Get ¶
func (mbean *Client) Get(domainName string, beanName string, attributeName string, args OperationArgs) (string, error)
Get is the method that will fetch the attribute given by the name The return value must be able to be converted to the java representation that the server is expecting If this is a complex type, then a handler will need to be defined
func (*Client) GetEnv ¶
GetEnv will expose the underlying environment that the client is associated with
func (*Client) OpenConnection ¶ added in v1.1.4
OpenConnection is a method that will establish a new connection against the given URI
func (*Client) Put ¶
func (mbean *Client) Put(domainName string, beanName string, attributeName string, args OperationArgs) (string, error)
Put is the method that will set the declared attribute to the given value The value must be able to be converted to the java representation that the server is expecting If this is a custom type, then a handler will need to be defined
func (*Client) RegisterClassHandler ¶
func (mbean *Client) RegisterClassHandler(typeName string, handler extensions.IHandler) error
RegisterClassHandler will register the given class handlers For a class handler to be valid it must implement a form of IClassHandler
func (*Client) RegisterInterfaceHandler ¶
func (mbean *Client) RegisterInterfaceHandler(typeName string, handler extensions.InterfaceHandler) error
RegisterInterfaceHandler will register the given class handlers For a class handler to be valid it must implement a form of IClassHandler
func (*Client) WithEnvironment ¶
func (mbean *Client) WithEnvironment(env *jnigi.Env) BeanExecutor
WithEnvironment allos the client to spin up a new client using a new environment This is handy when using the same JmxConnection in sub threads
type MockBeanExecutor ¶
MockBeanExecutor is an autogenerated mock type for the BeanExecutor type
func NewMockBeanExecutor ¶
func NewMockBeanExecutor(t mockConstructorTestingTNewMockBeanExecutor) *MockBeanExecutor
NewMockBeanExecutor creates a new instance of MockBeanExecutor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockBeanExecutor) Execute ¶
func (_m *MockBeanExecutor) Execute(operation Operation) (string, error)
Execute provides a mock function with given fields: operation
func (*MockBeanExecutor) Get ¶
func (_m *MockBeanExecutor) Get(domainName string, beanName string, attributeName string, args OperationArgs) (string, error)
Get provides a mock function with given fields: domainName, beanName, attributeName, args
func (*MockBeanExecutor) GetEnv ¶
func (_m *MockBeanExecutor) GetEnv() *jnigi.Env
GetEnv provides a mock function with given fields:
func (*MockBeanExecutor) OpenConnection ¶ added in v1.1.4
func (_m *MockBeanExecutor) OpenConnection(jndiURI string) (*jnigi.ObjectRef, error)
OpenConnection provides a mock function with given fields: jndiURI
func (*MockBeanExecutor) Put ¶
func (_m *MockBeanExecutor) Put(domainName string, beanName string, attributeName string, args OperationArgs) (string, error)
Put provides a mock function with given fields: domainName, beanName, attributeName, args
func (*MockBeanExecutor) RegisterClassHandler ¶
func (_m *MockBeanExecutor) RegisterClassHandler(typeName string, handler extensions.IHandler) error
RegisterClassHandler provides a mock function with given fields: typeName, handler
func (*MockBeanExecutor) RegisterInterfaceHandler ¶
func (_m *MockBeanExecutor) RegisterInterfaceHandler(typeName string, handler extensions.InterfaceHandler) error
RegisterInterfaceHandler provides a mock function with given fields: typeName, handler
func (*MockBeanExecutor) WithEnvironment ¶
func (_m *MockBeanExecutor) WithEnvironment(env *jnigi.Env) BeanExecutor
WithEnvironment provides a mock function with given fields: env
type Operation ¶
type Operation struct { Domain string Name string Operation string Args []OperationArgs }
Operation is the operation that is being performed Domain is the fully qualified name of the MBean `org.example` Name is the name of the mbean itself `game` Operation is the name of the operation that is attempted to be interacted with `getString` Args are the optional argument array that is for the operation
type OperationArgs ¶
OperationArgs is the type that holds data about the arguments used for MBean operations Value is the value that is being entered in string form JavaType is the fully qualified java type `java.lang.String` JavaContainerType is the fully qualified type of the container that will be holding JavaType