1 package org.apache.turbine.services.pull; 2 3 18 19 import org.apache.turbine.services.TurbineServices; 20 import org.apache.turbine.util.RunData; 21 22 import org.apache.velocity.context.Context; 23 24 36 public abstract class TurbinePull 37 { 38 44 public static PullService getService() 45 { 46 return (PullService) TurbineServices 47 .getInstance().getService(PullService.SERVICE_NAME); 48 } 49 50 57 public static final Context getGlobalContext() 58 { 59 return getService().getGlobalContext(); 60 } 61 62 73 public static final boolean isRegistered() 74 { 75 return TurbineServices.getInstance() 76 .isRegistered(PullService.SERVICE_NAME); 77 } 78 79 85 public static final String getAbsolutePathToResourcesDirectory() 86 { 87 return getService().getAbsolutePathToResourcesDirectory(); 88 } 89 90 96 public static final String getResourcesDirectory() 97 { 98 return getService().getResourcesDirectory(); 99 } 100 101 110 public static void populateContext(Context context, RunData data) 111 { 112 getService().populateContext(context, data); 113 } 114 115 128 public static final void refreshGlobalTools() 129 { 130 getService().refreshGlobalTools(); 131 } 132 133 140 public static final boolean refreshToolsPerRequest() 141 { 142 return getService().refreshToolsPerRequest(); 143 } 144 145 151 public static void releaseTools(Context context) 152 { 153 getService().releaseTools(context); 154 } 155 156 165 public static ApplicationTool getTool(Context context, 166 String name) 167 { 168 try 169 { 170 return (ApplicationTool) context.get(name); 171 } 172 catch (Exception e) 173 { 174 } 175 return null; 176 } 177 } 178 | Popular Tags |