Package org.sf.bee.commons.logging

Examples of org.sf.bee.commons.logging.Logger


        }
    }

    public JSONRPCResult call(final Object context[],
            final JSONObject jsonReq) {
        final Logger logger = LoggingUtils.getLogger(this);
        // #1: Parse the request
        final JSONRequest request;
        try {
            request = new JSONRequest(jsonReq);
        } catch (JSONException e) {
            logger.severe("no method or parameters in request");
            return new JSONRPCResult(JSONRPCResult.CODE_ERR_NOMETHOD, null,
                    JSONRPCResult.MSG_ERR_NOMETHOD);
        }
        if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.FINE, "call {0}", request.toString());
        }
        return null != request
                ? this.call(context, request)
                : new JSONRPCResult(JSONRPCResult.CODE_ERR_NOMETHOD, null,
                JSONRPCResult.MSG_ERR_NOMETHOD);
View Full Code Here


     * @return a JSONRPCResult object with the result of the invocation or an
     *         error.
     */
    public JSONRPCResult call(final Object context[],
            final JSONRequest request) {
        final Logger logger = LoggingUtils.getLogger(this);

        // #1: Parse the request
        // final JSONRequest request;
        // apply the fixups (if any) to the parameters. This will result
        // in a JSONArray that might have circular references-- so
        // the toString method (or anything that internally tries to traverse
        // the JSON (without being aware of this) should not be called after this
        // point

        if (request.hasFixUps()) {
            try {
                request.applyFixUps();
            } catch (JSONException e) {
                logger.log(Level.SEVERE, "error applying fixups", e);

                return new JSONRPCResult(JSONRPCResult.CODE_ERR_FIXUP, request.getId(),
                        JSONRPCResult.MSG_ERR_FIXUP + ": " + e.getMessage());
            }
        }
View Full Code Here

     * @param clazz The class object that should be marshalled as a callable
     *          reference.
     * @throws Exception if this method is called on the global bridge.
     */
    public void registerCallableReference(final Class clazz) throws Exception {
        final Logger logger = this.getLogger();
        if (this == _globalBridge) {
            throw new Exception("Can't register callable reference on global bridge");
        }
        if (!_referencesEnabled) {
            enableReferences();
        }
        synchronized (_callableReferenceSet) {
            _callableReferenceSet.add(clazz);
        }
        if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.FINE,
                    "registered callable reference {0}",
                    clazz.getName());
        }
    }
View Full Code Here

            }
            if (exists == null) {
                _classMap.put(name, clazz);
            }
        }
        final Logger logger = this.getLogger();
        if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.FINE,
                    "registered class {0} as {1}",
                    new Object[]{clazz.getName(), name});
        }
    }
View Full Code Here

     * @param key The named prefix to export the object as
     * @param o The object instance to be called upon
     */
    public void registerObject(final String key,
            final Object o) {
        final Logger logger = this.getLogger();
        ObjectInstance oi = new ObjectInstance(o);
        synchronized (_objectMap) {
            _objectMap.put(key, oi);
        }
        if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.FINE,
                    "registered object #{0} of class {1} as {2}",
                    new Object[]{o.hashCode(), o.getClass().getName(), key});
        }
    }
View Full Code Here

     *
     * @param clazz The class object that should be marshalled as a reference.
     * @throws Exception if this method is called on the global bridge.
     */
    public void registerReference(final Class clazz) throws Exception {
        final Logger logger = this.getLogger();
        if (this == _globalBridge) {
            throw new Exception("Can't register reference on global bridge");
        }
        if (!_referencesEnabled) {
            enableReferences();
        }
        synchronized (_referenceSet) {
            _referenceSet.add(clazz);
        }
        if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.FINE, "registered reference {0}",
                    clazz.getName());
        }
    }
View Full Code Here

     *
     * @param name The registered name of the class to unexport static methods
     *          from.
     */
    public void unregisterClass(final String name) {
        final Logger logger = this.getLogger();
        synchronized (_classMap) {
            Class clazz = (Class) _classMap.get(name);
            if (clazz != null) {
                _classMap.remove(name);
                if (logger.isLoggable(Level.FINE)) {
                    logger.log(Level.FINE,
                            "unregistered class {0} from {1}",
                            new Object[]{clazz.getName(), name});
                }
            }
        }
View Full Code Here

     *
     * @param key The named prefix of the object to unexport
     */
    public void unregisterObject(final String key) {
        synchronized (_objectMap) {
            final Logger logger = this.getLogger();
            final ObjectInstance oi = _objectMap.get(key);
            if (null!=oi && null!=oi.getObject()) {
                _objectMap.remove(key);
                if (logger.isLoggable(Level.FINE)) {
                    logger.log(Level.FINE,
                            "unregistered object {0} of class {1} "
                            + "from {2}",
                            new Object[]{
                                oi.getObject().hashCode(),
                                oi.getClazz().getName(),
View Full Code Here

     *
     * @param className The name of the class to resolve
     * @return The data associated with the className
     */
    private ClassData resolveClass(final String className) {
        final Logger logger = this.getLogger();
        Class clazz;
        ClassData cd = null;

        synchronized (_classMap) {
            clazz = (Class) _classMap.get(className);
        }

        if (clazz != null) {
            cd = ClassAnalyzer.getInstance().getClassData(clazz);
        }

        if (cd != null) {
            if (logger.isLoggable(Level.FINE)) {
                logger.log(Level.FINE,
                        "found class {0} named {1}",
                        new Object[]{
                            cd.getClazz().getName(),
                            className});
            }
View Full Code Here

     * @param key registered object key being requested by caller.
     * @return ObjectInstance that has been registered under this key, in this
     *         bridge or the global bridge.
     */
    private ObjectInstance resolveObject(final String key) {
        final Logger logger = this.getLogger();
        ObjectInstance oi;
        synchronized (_objectMap) {
            oi = _objectMap.get(key);
        }
        if (logger.isLoggable(Level.FINE) && oi != null) {
            logger.log(Level.FINE,
                    "found object {0} of class {1} "
                    + "with key {2}",
                    new Object[]{
                        oi.getObject().hashCode(),
                        oi.getClazz().getName(),
View Full Code Here

TOP

Related Classes of org.sf.bee.commons.logging.Logger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.