alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 * NodeFactory.java
 *
 * Created on December 21, 2003, 8:19 AM
 */

package org.netbeans.tests.j2eeserver.plugin.registry;

import org.netbeans.tests.j2eeserver.plugin.jsr88.*;
import javax.enterprise.deploy.spi.factories.DeploymentFactory;
import javax.enterprise.deploy.spi.DeploymentManager;
import javax.enterprise.deploy.spi.Target;
/**
 *
 * @author  nn136682
 */
public class NodeFactory implements org.netbeans.modules.j2ee.deployment.plugins.api.RegistryNodeFactory {
    
    /** Creates a new instance of NodeFactory */
    public NodeFactory() {
    }
    
    public org.openide.nodes.Node getFactoryNode(org.openide.util.Lookup lookup) {
        DeploymentFactory depFactory = (DeploymentFactory) lookup.lookup(DeploymentFactory.class);
        if (depFactory == null || ! (depFactory instanceof DepFactory)) {
            System.out.println("WARNING: getFactoryNode lookup returned "+depFactory);
            return null;
        }
        System.out.println("INFO: getFactoryNode returning new plugin node");
        return new PluginNode((DepFactory)depFactory);
    }
    
    public org.openide.nodes.Node getManagerNode(org.openide.util.Lookup lookup) {
        DeploymentManager depManager = (DeploymentManager) lookup.lookup(DeploymentManager.class);
        if (depManager == null || ! (depManager instanceof DepManager)) {
            System.out.println("WARNING: getManagerNode lookup returned "+depManager);
            return null;
        }
        System.out.println("INFO: getManagerNode returning new Manager node");
        return new ManagerNode((DepManager)depManager);
    }
    
    public org.openide.nodes.Node getTargetNode(org.openide.util.Lookup lookup) {
        Target target = (Target) lookup.lookup(Target.class);
        if (target == null || ! (target instanceof Targ) ) {
            System.out.println("WARNING: getTargetNode lookup returned "+target);
            return null;
        }
        System.out.println("INFO: getManagerNode returning new Target node");
        return new TargNode((Targ)target);
    }
}
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.