1 19 20 21 package org.netbeans.tests.j2eeserver.plugin.registry; 22 23 import org.netbeans.tests.j2eeserver.plugin.jsr88.*; 24 import javax.enterprise.deploy.spi.factories.DeploymentFactory ; 25 import javax.enterprise.deploy.spi.DeploymentManager ; 26 import javax.enterprise.deploy.spi.Target ; 27 31 public class NodeFactory implements org.netbeans.modules.j2ee.deployment.plugins.api.RegistryNodeFactory { 32 33 34 public NodeFactory() { 35 } 36 37 public org.openide.nodes.Node getFactoryNode(org.openide.util.Lookup lookup) { 38 DeploymentFactory depFactory = (DeploymentFactory ) lookup.lookup(DeploymentFactory .class); 39 if (depFactory == null || ! (depFactory instanceof DepFactory)) { 40 System.out.println("WARNING: getFactoryNode lookup returned "+depFactory); 41 return null; 42 } 43 System.out.println("INFO: getFactoryNode returning new plugin node"); 44 return new PluginNode((DepFactory)depFactory); 45 } 46 47 public org.openide.nodes.Node getManagerNode(org.openide.util.Lookup lookup) { 48 DeploymentManager depManager = (DeploymentManager ) lookup.lookup(DeploymentManager .class); 49 if (depManager == null || ! (depManager instanceof DepManager)) { 50 System.out.println("WARNING: getManagerNode lookup returned "+depManager); 51 return null; 52 } 53 System.out.println("INFO: getManagerNode returning new Manager node"); 54 return new ManagerNode((DepManager)depManager); 55 } 56 57 public org.openide.nodes.Node getTargetNode(org.openide.util.Lookup lookup) { 58 Target target = (Target ) lookup.lookup(Target .class); 59 if (target == null || ! (target instanceof Targ) ) { 60 System.out.println("WARNING: getTargetNode lookup returned "+target); 61 return null; 62 } 63 System.out.println("INFO: getManagerNode returning new Target node"); 64 return new TargNode((Targ)target); 65 } 66 } 67 | Popular Tags |