1 28 29 package org.objectweb.util.browser.plugins.fractal.context; 30 31 import org.objectweb.fractal.api.NoSuchInterfaceException; 32 import org.objectweb.fractal.api.control.LifeCycleController; 33 import org.objectweb.util.browser.api.Context; 34 import org.objectweb.util.browser.api.Entry; 35 import org.objectweb.util.browser.api.Wrapper; 36 import org.objectweb.util.browser.plugins.fractal.FcBrowser; 37 import org.objectweb.util.browser.plugins.fractal.api.FractalContext; 38 39 44 public abstract class DefaultFractalContext 45 implements Context, 46 Wrapper, 47 FractalContext 48 { 49 50 56 57 protected Object object_; 58 59 65 71 77 81 public Entry[] getEntries() { 82 LifeCycleController lcc = null; 83 try { 84 lcc = FcBrowser.getLifeCycleController(FcBrowser.getComponent(object_)); 85 } catch (NoSuchInterfaceException e2) { 86 try { 87 return getStartedEntries(); 88 } catch (Exception e1) { 89 return getStoppedEntries(); 90 } 91 } 92 if (lcc.getFcState().equals(LifeCycleController.STARTED)) 93 return getStartedEntries(); 94 else 95 return getStoppedEntries(); 96 } 97 98 104 108 public abstract Entry[] getStartedEntries() ; 109 110 114 public Entry[] getStoppedEntries() { 115 return new Entry[0]; 116 } 117 118 124 128 public void setWrapped(Object object) { 129 object_ = object; 130 } 131 132 136 public Object getWrapped() { 137 return object_; 138 } 139 } | Popular Tags |