/** * Gets the formatted string with the given arguments. * @param key the keystring on which to apply arguments * @param obj1 the first object argument for the formatter * @param obj2 the second object argument for the formatter * @return the formatted string */ public String getMessage(final String key, final Object obj1, final Object obj2) { return getMessage(key, new Object[] {obj1, obj2 }); }
/** * @return true if JDK 1.4 or later */ public static boolean isJAVA4() { return (getJavaVersion() >= JAVA_1_4); } }
/** * Return an object from an array of bytes. Useful for BinaryRefAddr * Useful for BinaryRefAddr * @param bytes an array of bytes * @return an object or null if there is an error of if it's empty */ public static Object getObjectFromBytes(byte[] bytes) { return getObjectFromBytes(bytes, null); }
/** * Returns the standard PrintWriter associated to the logger defined by * its topic. * This is mainly used for DBM and Connectors. */ public static PrintWriter getLogWriter(final String topic) { // TODO : should not create a new object at each call return new PrintWriterImpl(getLogger(topic), getLoggerFactory()); }
/** * @return list of properties for logging system */ public Properties getProperties() { Properties props = Log.getProperties(); if (props == null) { Log.getLoggerFactory(); props = Log.getProperties(); } return props; }
/** * Shortcut that returns the LevelFactory */ public static LevelFactory getLevelFactory() { return (LevelFactory) getLoggerFactory(); }
/** * Return an array of byte from a given object * @param obj the object from which we must extract the bytes. * @return the byte[] from an object */ public static byte[] getBytesFromObject(Object obj) { return getBytesFromObject(obj, null); }
/** * Serialize the encapsulated Document into the Writer * * @param writer writer * * @throws IOException When serialization fails */ public void serialize(Writer writer) throws IOException { output.setCharacterStream(writer); serialize(); }
/** * Get the Jorm Class name in JOrm Meta Info * It is built from the Abstract Shema Name. * @return the Jorm Class Name */ private String getJormCName() { if (jormClassName == null) { jormClassName = BeanNaming.firstToUpperCase(abstractSchemaName); } return jormClassName; }
public static ArrayList<String> getMailFactoryPropsInDir() throws Exception { return getMailFactoryPropsInDir(null); }
/** * War MBean ObjectName * @param domainName domain name * @param filename name of the file containing the war * @return War MBean ObjectName * @throws MalformedObjectNameException Could not construct ObjectName */ public static ObjectName war(final String domainName, final String filename) throws MalformedObjectNameException { return ObjectName.getInstance(domainName + ":type=war,fname=" + fileNameForObjectName(filename)); }
/** * Gets the instance for a given package. * @param packageName the package for which we want a bundle * @return I18n object */ public static I18n getInstance(final String packageName) { return getInstance(packageName, Thread.currentThread().getContextClassLoader()); }
/** * Gets the formatted string with the given arguments. * @param key the keystring on which to apply arguments * @param obj the object argument for the formatter * @return the formatted string */ public String getMessage(final String key, final Object obj) { return getMessage(key, new Object[] {obj}); }
/** * Configure Logger. * @param file The configuration file for monolog (usually: trace.properties) */ public static void configure(final String file) { configFile = file; getLoggerFactory(); if (!clientcontainer) { // TODO find a good place for this initialization // to allow using Monolog when want traces of P6Spy usage in SQL requests //P6SpyLogger.logger = lf.getLogger(SPY_LOGGER_NAME); // ----------- // Comment out call until JONAS uses Log4j // TraceTm.configure(lf); } }
/** * @return true if JDK 1.2 or later */ public static boolean isJAVA2() { return (getJavaVersion() >= JAVA_1_2); }
/** * Serialize the encapsulated Document into the OutputStream * * @param os output stream * * @throws IOException When serialization fails */ public void serialize(OutputStream os) throws IOException { output.setByteStream(os); serialize(); }
/** * Gets the formatted string with the given arguments. * @param key the keystring on which to apply arguments * @param obj1 the first object argument for the formatter * @param obj2 the second object argument for the formatter * @param obj3 the third object argument for the formatter * @return the formatted string */ public String getMessage(final String key, final Object obj1, final Object obj2, final Object obj3) { return getMessage(key, new Object[] {obj1, obj2, obj3 }); }
/** * Shortcut to get the Logger by its topic name. * @param topic the topic of the returned logger * @return always a logger instance (never null value). */ public static Logger getLogger(final String topic) { return getLoggerFactory().getLogger(topic); }
/** * Gets the formatted string with the given arguments. * @param key the keystring on which to apply arguments * @param obj1 argument for the formatter * @param obj2 argument for the formatter * @param obj3 argument for the formatter * @param obj4 argument for the formatter * @return the formatted string */ public String getMessage(final String key, final Object obj1, final Object obj2, final Object obj3, final Object obj4) { return getMessage(key, new Object[] {obj1, obj2, obj3, obj4 }); }
/** * Gets the formatted string with the given arguments. * @param key the keystring on which to apply arguments * @param args the object arguments for the formatter * @return the formatted string */ public String getMessage(final String key, final Object[] args) { String value = getMessage(key); return MessageFormat.format(value, args); }