Package com.sun.identity.log.messageid
Class MessageProviderFactory
- java.lang.Object
-
- com.sun.identity.log.messageid.MessageProviderFactory
-
public final class MessageProviderFactory extends Object
This factory provides us when message provider for different components. Sample code is as follow.try { LogMessageProvider provider = MessageProviderFactory.getProvider( "Console"); } catch (IOException e) { System.out.println(e.getMessage()); }This will return a message provider class for console.ConsoleLogMessageIDs.xmlis the XML file used for getting all message IDs."Console"+"LogMessageIDs.xml"where"Console"is the name passed into thegetProvidermethod.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_MESSAGE_ID_XML_DIRDefault package for message XML file.static StringMESSAGEID_XML_SUFFIXSuffix of message ID XML file.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static LogMessageProvidergetProvider(String name)Returns an instance of provider.static LogMessageProvidergetProvider(String name, String packageName)Returns an instance of provider.
-
-
-
Field Detail
-
DEFAULT_MESSAGE_ID_XML_DIR
public static final String DEFAULT_MESSAGE_ID_XML_DIR
Default package for message XML file.- See Also:
- Constant Field Values
-
MESSAGEID_XML_SUFFIX
public static final String MESSAGEID_XML_SUFFIX
Suffix of message ID XML file.- See Also:
- Constant Field Values
-
-
Method Detail
-
getProvider
public static LogMessageProvider getProvider(String name) throws IOException
Returns an instance of provider.- Parameters:
name- Name of provider- Returns:
- an instance of provider.
- Throws:
IOException- if corresponding XML file is not found.
-
getProvider
public static LogMessageProvider getProvider(String name, String packageName) throws IOException
Returns an instance of provider.- Parameters:
name- Name of providerpackageName- Package name where log message id XML file is located.- Returns:
- an instance of provider.
- Throws:
IOException- if corresponding XML file is not found.
-
-