1 48 49 package com.caucho.services.server; 50 51 import javax.servlet.ServletConfig ; 52 import javax.servlet.ServletContext ; 53 import javax.servlet.ServletException ; 54 import javax.servlet.ServletRequest ; 55 56 59 public class GenericService implements Service { 60 protected ServletConfig config; 61 62 65 public void init(ServletConfig config) 66 throws ServletException 67 { 68 this.config = config; 69 70 init(); 71 } 72 73 76 public void init() 77 throws ServletException 78 { 79 } 80 81 84 public String getInitParameter(String name) 85 { 86 return this.config.getInitParameter(name); 87 } 88 89 92 public ServletConfig getServletConfig() 93 { 94 return this.config; 95 } 96 97 100 public ServletContext getServletContext() 101 { 102 return this.config.getServletContext(); 103 } 104 105 108 public void log(String message) 109 { 110 getServletContext().log(message); 111 } 112 113 116 public ServletRequest getRequest() 117 { 118 return ServiceContext.getRequest(); 119 } 120 121 124 public String getServiceName() 125 { 126 return ServiceContext.getServiceName(); 127 } 128 129 134 public String getServiceId() 135 { 136 return getServiceName(); 137 } 138 139 142 public String getObjectId() 143 { 144 return ServiceContext.getObjectId(); 145 } 146 147 150 public void destroy() 151 { 152 } 153 } 154 | Popular Tags |