1 19 20 package org.netbeans.modules.j2ee.ddloaders.multiview; 21 22 import org.netbeans.modules.j2ee.dd.api.ejb.EntityAndSession; 23 import org.netbeans.modules.j2ee.ejbcore.api.methodcontroller.AbstractMethodController; 24 import org.openide.filesystems.FileObject; 25 import java.beans.PropertyChangeEvent ; 26 import java.beans.PropertyChangeListener ; 27 import java.io.IOException ; 28 import java.util.Iterator ; 29 import java.util.LinkedList ; 30 import java.util.List ; 31 import org.openide.nodes.Node; 32 33 36 public abstract class EntityAndSessionHelper implements PropertyChangeListener , PropertyChangeSource { 37 38 protected final EntityAndSession ejb; 39 protected final EjbJarMultiViewDataObject ejbJarMultiViewDataObject; 40 protected final FileObject ejbJarFile; 41 42 44 private List listeners = new LinkedList (); 45 public AbstractMethodController abstractMethodController; 46 47 public EntityAndSessionHelper(EjbJarMultiViewDataObject ejbJarMultiViewDataObject, EntityAndSession ejb) { 48 this.ejb = ejb; 49 this.ejbJarMultiViewDataObject = ejbJarMultiViewDataObject; 50 this.ejbJarFile = ejbJarMultiViewDataObject.getPrimaryFile(); 51 ejbJarMultiViewDataObject.getEjbJar().addPropertyChangeListener(this); 53 } 54 55 59 63 public void removeInterfaces(boolean local) { 64 } 95 96 public void modelUpdatedFromUI() { 97 ejbJarMultiViewDataObject.modelUpdatedFromUI(); 98 } 99 100 private void removeBeanInterface(String name) { 101 } 104 105 public String getEjbClass() { 106 return ejb.getEjbClass(); 107 } 108 109 public String getLocal() { 110 return ejb.getLocal(); 111 } 112 113 public String getLocalHome() { 114 return ejb.getLocalHome(); 115 } 116 117 public String getRemote() { 118 return ejb.getRemote(); 119 } 120 121 public String getHome() { 122 return ejb.getHome(); 123 } 124 125 139 public void addInterfaces(boolean local) { 140 String packageName = Utils.getPackage(ejb.getEjbClass()); 142 } 197 198 210 private static void generateHomeInterface(String oldHome, String newHome, String oldBusiness, String newBusiness, boolean remote, FileObject foForClasspath) throws IOException { 211 boolean rollback = true; 212 } 259 260 266 282 284 289 293 protected Node createEntityNode() { 294 return null; 296 } 297 298 public void addPropertyChangeListener(PropertyChangeListener listener) { 299 listeners.add(listener); 300 } 301 302 public void removePropertyChangeListener(PropertyChangeListener listener) { 303 listeners.remove(listener); 304 } 305 306 protected void firePropertyChange(PropertyChangeEvent evt) { 307 for (Iterator iterator = listeners.iterator(); iterator.hasNext();) { 308 ((PropertyChangeListener ) iterator.next()).propertyChange(evt); 309 } 310 } 311 312 public void propertyChange(PropertyChangeEvent evt) { 313 } 314 315 } 319 | Popular Tags |