1 package org.apache.fulcrum; 2 3 56 57 import java.rmi.RemoteException ; 58 import java.rmi.server.UnicastRemoteObject ; 59 import org.apache.commons.configuration.Configuration; 60 import org.apache.log4j.Category; 61 62 72 public class BaseUnicastRemoteService 73 extends UnicastRemoteObject 74 implements Service 75 { 76 protected Configuration configuration; 77 private boolean isInitialized; 78 private String name; 79 private ServiceBroker serviceBroker; 80 81 public BaseUnicastRemoteService() 82 throws RemoteException 83 { 84 isInitialized = false; 85 name = null; 86 serviceBroker = null; 87 } 88 89 94 public Configuration getConfiguration() 95 { 96 if (name == null) 97 { 98 return null; 99 } 100 else 101 { 102 if (configuration == null) 103 { 104 configuration = getServiceBroker().getConfiguration(name); 105 } 106 return configuration; 107 } 108 } 109 110 public void init() 111 throws InitializationException 112 { 113 setInit(true); 114 } 115 116 protected void setInit(boolean value) 117 { 118 isInitialized = value; 119 } 120 121 public boolean isInitialized() 122 { 123 return isInitialized; 124 } 125 126 129 public void shutdown() 130 { 131 setInit(false); 132 } 133 134 public void setName(String name) 135 { 136 this.name = name; 137 } 138 139 public String setName() 140 { 141 return name; 142 } 143 144 public ServiceBroker getServiceBroker() 145 { 146 return serviceBroker; 147 } 148 149 public void setServiceBroker(ServiceBroker broker) 150 { 151 this.serviceBroker = broker; 152 } 153 154 public String getRealPath(String path) 155 { 156 return null; 157 } 158 159 public Category getCategory() 160 { 161 return null; 162 } 163 164 public Category getCategory(String name) 165 { 166 return null; 167 } 168 169 176 public String getStatus() 177 throws ServiceException 178 { 179 return (isInitialized() ? "Initialized" : "Uninitialized"); 180 } 181 } 182 | Popular Tags |