1 17 18 package org.sape.carbon.core.component.lifecycle.test; 19 20 import org.sape.carbon.core.component.Component; 21 import org.sape.carbon.core.component.ComponentConfiguration; 22 import org.sape.carbon.core.component.lifecycle.ComponentLifecycle; 23 24 25 33 public class TestComponentImpl implements TestComponent, ComponentLifecycle { 34 35 TestListener listener; 36 37 Component thisComponent; 38 39 40 public TestComponentImpl() { 41 this.listener = null; 42 } 43 44 45 public TestComponentImpl(TestListener listener) { 46 this.listener = listener; 47 } 48 49 54 public void suspend() { 55 if (this.listener != null) { 56 this.listener.suspendCalled(); 57 } 58 } 59 60 63 public void destroy() { 64 if (this.listener != null) { 65 this.listener.destroyCalled(); 66 } 67 } 68 69 73 public void initialize(Component thisComponent) { 74 this.thisComponent = thisComponent; 75 76 if (this.listener != null) { 77 this.listener.initializeCalled(); 78 } 79 } 80 81 86 public void resume() { 87 if (this.listener != null) { 88 this.listener.resumeCalled(); 89 } 90 } 91 92 96 public void configure(ComponentConfiguration configuration) { 97 if (this.listener != null) { 98 this.listener.configureCalled(); 99 } 100 } 101 102 108 public void stop() { 109 if (this.listener != null) { 110 this.listener.stopCalled(); 111 } 112 } 113 114 119 public void start() { 120 if (this.listener != null) { 121 this.listener.startCalled(); 122 } 123 } 124 125 128 public void doSomething() { 129 } 130 131 public Component getThisComponent() { 132 return this.thisComponent; 133 } 134 135 } 136 | Popular Tags |