|
Log4j 1.1.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.log4j.examples.appserver.AppServerCategoryFactory
Creates correctly populated instances of
AppServerCategory
.
An attempt is made to
determine the hostname
using the
java.net
API. The other three attributes,
can be set via the constructor. All four attributes may be obtained and set through getters and setters.
Field Summary | |
protected String |
component
The name of the component using this factory. |
protected String |
hostname
The hostname on which this factory resides. |
protected ResourceBundle |
messageBundle
The message bundle to be used by AppServerCategory instances. |
protected String |
server
The application server name for this factory. |
protected String |
version
An identifier for this particular version/release. |
Constructor Summary | |
AppServerCategoryFactory()
The default constructor merely calls the three-argument constructor with null values. |
|
AppServerCategoryFactory(String serverName,
String componentName,
String versionName)
Construct a new AppServerCategoryFactory with
the provided attributes. |
Method Summary | |
String |
getComponent()
Get the name of the component for which this category is logging. |
String |
getHostname()
Get the hostname of the machine on which this category is running. |
String |
getServer()
Get the name of the server process in which this category is running. |
String |
getVersion()
Get the version name of the component in which this category is running. |
Category |
makeNewCategoryInstance(String name)
Create a new instance of AppServerCategory
using the information contained in this instance. |
void |
setComponent(String component)
Set the name of the component for which the category will be logging. |
void |
setHostname(String hostname)
Set the host name of the component on which this category is running. |
void |
setMessageBundle(ResourceBundle bundle)
Set the message bundle to be used for all Category
objects created by this CatgoryFactory .
param bundle a bundle of messages |
void |
setMessageBundle(String filename)
Set the message bundle using the bundle filename. |
void |
setServer(String server)
Set the name of the application server process in which this category is logging. |
void |
setVersion(String version)
Set the version string for the component. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected String hostname
protected String server
protected String component
protected String version
protected ResourceBundle messageBundle
Constructor Detail |
public AppServerCategoryFactory(String serverName, String componentName, String versionName)
AppServerCategoryFactory
with
the provided attributes. An attempt is made to obtain the
hostname from the java.net API. This constructor sets the
newly created instance as the default factory for future
invocations of AppServerCategory.getInstance(String)
via AppServerCategory.setFactory(org.apache.log4j.spi.CategoryFactory)
.categoryName
- the name of the category.serverName
- the name of the server using this category. This
may be null.componentName
- the name of the component using this category.
This may be null.versionName
- the version identifier of the component. This may
may be null.public AppServerCategoryFactory()
Method Detail |
public String getComponent()
public String getHostname()
public String getServer()
public String getVersion()
public Category makeNewCategoryInstance(String name)
AppServerCategory
using the information contained in this instance.makeNewCategoryInstance
in interface CategoryFactory
public void setComponent(String component)
component
- name of componentpublic void setHostname(String hostname)
hostname
- the host name.public void setMessageBundle(ResourceBundle bundle)
Category
objects created by this CatgoryFactory
.
param bundle a bundle of messagespublic void setMessageBundle(String filename)
.properties
" extension.
Care should be taken to ensure the bundle file is somewhere
in the system classpath or loadable by this class's class
loader.filename
- name of the bundle filepublic void setServer(String server)
server
- name of application server process.public void setVersion(String version)
version
- version name of component
|
Log4j 1.1.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |