Examples of ComponentManager


Examples of org.apache.avalon.framework.component.ComponentManager

     * If none is specified, the method returns <code>null</code>.
     *
     * @return the parent component manager, or <code>null</code>.
     */
    private synchronized ComponentManager getParentComponentManager() {
        ComponentManager parentComponentManager = null;
        if (parentComponentManagerClass != null) {
            try {
                String initParam = null;
                int dividerPos = parentComponentManagerClass.indexOf('/');
                if (dividerPos != -1) {
View Full Code Here

Examples of org.apache.avalon.framework.component.ComponentManager

        if (config == null) {
            getLogger().debug("Sitemap has no components definition at " + tree.getLocation());
            config = new DefaultConfiguration("", "");
        }

        ComponentManager manager = new CocoonComponentManager(this.parentManager);

        LifecycleHelper.setupComponent(manager,
            getLogger(),
            this.context,
            this.parentManager,
            this.roleManager,
            this.logKit,
            config
        );

        // Set parent of all selectors.
        if (this.parentManager != null) {

            for (int i = 0; i < ComponentsSelector.SELECTOR_ROLES.length; i++) {

                String role = ComponentsSelector.SELECTOR_ROLES[i];

                ComponentSelector parentSelector = null;
                try {
                    parentSelector = (ComponentSelector)this.parentManager.lookup(role);
                } catch(Exception e) {
                    // ignore and keep it null
                }

                if (parentSelector != null) {

                    ExtendedComponentSelector localSelector = null;
                    try {
                        localSelector = (ExtendedComponentSelector)manager.lookup(role);

                        if (localSelector != parentSelector) {
                            // local selector wasn't given by chaining to the parent manager
                            localSelector.setParentSelector(parentSelector);
                        }
                        manager.release(localSelector);

                    } catch(Exception e) {
                        // ignore
                    }
View Full Code Here

Examples of org.apache.avalon.framework.component.ComponentManager

   * @exception Exception if an error occurs during parsing.
   */
  public Value parse(Value sManager, Value ssource)
    throws Exception
  {
    ComponentManager manager = componentManager(sManager);
    Source source = source(ssource);

    Parser parser = (Parser)manager.lookup(Parser.ROLE);
    XMLtoSXML handler = new XMLtoSXML();
    parser.setContentHandler(handler);
    InputSource input = new InputSource(source.getInputStream());
    parser.parse(input);

    SchemeInterpreter interpreters
      = (SchemeInterpreter)manager.lookup(SchemeInterpreter.ROLE);
    Symbol mainFunction = interpreters.getMainFunction();
    Interpreter interp = interpreters.getInterpreter();

    try {
      return interp.eval(handler.getContent());
View Full Code Here

Examples of org.apache.avalon.framework.component.ComponentManager

  {
    JSCocoon cocoon = (JSCocoon)args[0];
    // FIXME: why doesn't this work???
//     ComponentManager contMgr
//       = ((ComponentManager)manager).lookup(ContinuationsManager.ROLE);
    ComponentManager manager = cocoon.getComponentManager();

    ContinuationsManager contMgr = cocoon.getContinuationsManager();
    Object kont = args[1];
    Object pwk = args[2];
View Full Code Here

Examples of org.apache.avalon.framework.component.ComponentManager

     * If none is specified, the method returns <code>null</code>.
     *
     * @return the parent component manager, or <code>null</code>.
     */
    private synchronized ComponentManager getParentComponentManager() {
        ComponentManager parentComponentManager = null;
        if (parentComponentManagerClass != null) {
            try {
                String initParam = null;
                int dividerPos = parentComponentManagerClass.indexOf('/');
                if (dividerPos != -1) {
View Full Code Here

Examples of org.apache.avalon.framework.component.ComponentManager

  private String ListTable="";
  private  DataSourceComponent datasource;
    public void init() throws MessagingException {
        try{
              ListTable = getCondition();
              ComponentManager componentManager = (ComponentManager)getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
              // Get the DataSourceSelector block
              DataSourceSelector datasources = (DataSourceSelector)componentManager.lookup(DataSourceSelector.ROLE);
              // Get the data-source required.
              int stindex = ListTable.indexOf("://")+3;
              int endindex = ListTable.indexOf("/",stindex);
              String datasourceName = ListTable.substring(stindex,endindex);
              datasource = (DataSourceComponent)datasources.select(datasourceName);
View Full Code Here

Examples of org.apache.avalon.framework.component.ComponentManager

        membersTable = getInitParameter("members_table");
        peopleTable = getInitParameter("people_table");
        Connection conn = null;

        try {
            ComponentManager componentManager = (ComponentManager)getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
            // Get the DataSourceSelector block
            DataSourceSelector datasources = (DataSourceSelector)componentManager.lookup(DataSourceSelector.ROLE);
            // Get the data-source required.
            datasource = (DataSourceComponent)datasources.select(datasourceName);

            conn = datasource.getConnection();
View Full Code Here

Examples of org.apache.avalon.framework.component.ComponentManager

        }

        Connection conn = null;

        try {
            ComponentManager componentManager = (ComponentManager)getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
            // Get the DataSourceSelector block
            DataSourceSelector datasources = (DataSourceSelector)componentManager.lookup(DataSourceSelector.ROLE);
            // Get the data-source required.
            datasource = (DataSourceComponent)datasources.select(datasourceName);

            conn = datasource.getConnection();
View Full Code Here

Examples of org.apache.avalon.framework.component.ComponentManager

public class AvalonListservManager extends GenericListservManager {

    private UsersRepository members;

    public void init() {
        ComponentManager compMgr = (ComponentManager)getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
        try {
            UsersStore usersStore = (UsersStore) compMgr.lookup("org.apache.james.services.UsersStore");
            String repName = getInitParameter("repositoryName");

            members = (UsersRepository) usersStore.getRepository(repName);
        } catch (ComponentException cnfe) {
            log("Failed to retrieve Store component:" + cnfe.getMessage());
View Full Code Here

Examples of org.apache.avalon.framework.component.ComponentManager

            replyToList = new Boolean(getInitParameter("replytolist")).booleanValue();
        } catch (Exception e) {
        }
        subjectPrefix = getInitParameter("subjectprefix");

        ComponentManager compMgr = (ComponentManager)getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
        try {
            UsersStore usersStore = (UsersStore)compMgr.lookup("org.apache.james.services.UsersStore");
            String repName = getInitParameter("repositoryName");

            members = (UsersRepository)usersStore.getRepository( repName );
        } catch (ComponentException cnfe) {
            log("Failed to retrieve Store component:" + cnfe.getMessage());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.