/* JFox, the OpenSource J2EE Application Server
 *
 * Distributable under GNU LGPL license by gun.org
 * more details please visit http://www.huihoo.org/jfox
 */

package org.jfox.framework.sample;

import org.jfox.framework.ComponentContext;
import org.jfox.framework.extra.Managable;
import org.jfox.framework.extra.ManagementInfo;

/**
 * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
 */

public class BComponent implements Managable {

    private int id = 0;
    private String name = "Hello,World from BComponent";
    private Long time = new Long(System.currentTimeMillis());

    private ComponentContext ctx;

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setTime(Long time) {
        this.time = time;
    }

    public Long getTime() {
        return time;
    }

    public ManagementInfo getManagementInfo() {
        return ManagementInfo.exposeDeclaring(BComponent.class);
    }

    public void setComponentContext(ComponentContext ctx) {
        this.ctx = ctx;
    }

    public String getComponentDir(){
        return ctx.getModuleDir();
    }

    public static void main(String[] args) {

    }

}

