Administrator Wizard
Introduction
Avalon is a server framework (which provides or serves central administration, service pool, timely market market. The framework defines a set of standard methods for your service components and creation application servers.
Target population
This document will explain the core of managing Avalon Phenix as an administrator's perspective.
Start and stop
Application script
You can start Phoenix:> bin / run. [Bat | sh] with the following command:> bin / run.
In the Windows environment, do not include NT, you need to set the phoenix_home environment variable first. In the UNIX environment, you can stop Phoenix:> Phoenix.sh Stop with phoenix.sh scripts:> phoenix.sh stop
Phoenix.sh scripts Receive the following command: Start, Stop, Run, Restart, Check.
In Windows, pressing Control-C will completely close Phoenix.
Use Java Service Wrapper
Another start / close PHOENIX selection is to build a new Phoenix using Java Service Wrapper.
The main benefit of using Java Service Wrapper is to make Phoenix as a NT service. It can detect if the JVM is frozen or collapsed and restart the application immediately.
To build Phoenix with Java Service Wrapper, download and check its latest version. Then, create or edit Ant.properties in the root of the source program, as follows:
# $ {base.path} points to the root of the
Phoenix
Source Tree
Wrapper.home = $ {base.path} / wrapper_linux_
3.0.0
Wrapper.jar = $ {wrapper.home} /lib/wrapper.jar
# If you're using linux / solaris:
Wrapper.exe = $ {wrapper.home} / bin / wrapper
Wrapper.dll = $ {wrapper.home} /lib/libwrapper.so
# If you're using windows:
Wrapper.exe = $ {wrapper.home} /bin/wrapper.exe
Wrapper.dll = $ {wrapper.home} /lib/wrapper.dll
Then like a general engineering.
If you want to use the instruction, move the bin directory of the current path, then type:> wrapper
Wrapper's profile is usually named conf / wrapper.conf.
JMX
JMX overview
Phoenix is closely integrated with JMX (Java Management Extensions). Please see JMX information
How to make your block become a MBean
In fact, this is simple. Suppose you want to expose interfaces from WebServer Block, WebServer Block has a description in the Block configuration person. You only need to do two things.
First, create an MBEAN interface, as follows:
Package examplecomp.block;
Public interface webservembean {
Void Mountwar (String ContextName, URL Pathtowar);
Void unmountwar;
}
Note that the interface of the MBean and the interface of WebServer are the same. This is like this in most cases.
Write WebServerBlock now WEBSERVERMBEAN
Package examplecomp.block;
/ **
* Todo: Describe phoenixxdoclet setup. * @Phoenix: mx name = "eXampleComp.block.webservermbean"
* /
Public Class WebserveBlock
Extends AbstractLogGable
Implements Webserver, Webservermbean, Startable, Configurable, Initializable {
// ...
}
Use HTTP Adapter
The MX4J HTTP adapter allows you to use any browser to access the running phoenix server.
Use RMI adapter
If you want to write an agent to manage the Phoenix program, you can use the MX4J RMI adapter. This section mainly repeats the available information in the MX4J document. Phoenix uses a JRMP RMI adapter.
Make sure the MX4J RMI adapter is valid in Kernal.xml.
Class = "org.apache.avalon.phoenix.components.manager.mx4jsystemmanager" Logger = "manager"> [other enabled adaptors] component> Set MX4J-JMX.jar, MX4J-Tools.jar, and JINI.PROPERTIES path in your classpath, assume that you want to close Phoenix. Create the following class: Import mx4j.connector.rmi.jrmp.jrmpConnector; Import mx4j.connector.remotembeanserver; Import javax.management.Objectname; Public class jrmpshutdown { Public static void main (string [] args) Throws Exception { // CREATE A JRMPCONNECTOR JRMPConnector Connector = New JRMPCONNECTOR (); // Pass in the adaptor's jndi name, no property String Jndiname = "JRMP"; Connector.Connect (JNDINAME, NULL); // Get The Remote MBeanserver from the Connector // and use it as if it is an MBeanServer RemoteMbeanServer Server = connector.getremotembeanserver (); Objectname objName = new objectname (" Phoenix : Component = Embeddor, Topic = Embeddor "); Server.invoke (ObjName, "Shutdown", New Object [0], New String [0]); } } Compile and run - very fast! The server stopped. solve questions PHOENIX has not been reported to any error message after PHOENIX startup. Make sure there is a SAR file in the App folder. If you don't have any services running Phoenix will quickly exit. In fact, you can stop Phoenix services through JMX without configuring any applications (although this way is very strange). David W. Written