Package ccw.util.osgi

Examples of ccw.util.osgi.RunnableWithException


  public void execute(final IEclipseContext context) throws CoreException {
    if (var == null) {
        var = BundleUtils.requireAndGetVar("ccw.core", varName);
    }
    ClojureOSGi.withBundle(CCWPlugin.getDefault().getBundle(),
        new RunnableWithException() {
          @Override public Object run() throws Exception {
            var.invoke(context);
            return null;
          }
        });
View Full Code Here


  public static Var requireAndGetVar(final Bundle bundle, final String varName) throws CoreException {
    final String[] nsFn = varName.split("/");
    try {
      final String nsName = nsFn[0];
      ClojureOSGi.require(bundle, nsName);
      return (Var) ClojureOSGi.withBundle(bundle, new RunnableWithException() {
        @Override
        public Object run() throws Exception {
          try {
            return RT.var(nsName, nsFn[1]);
          } catch( Exception e) {
View Full Code Here

  private Var factory;
  private Map<String, String> factoryParams;
 
  public Object create() throws CoreException {
    try {
      return ClojureOSGi.withBundle(CCWPlugin.getDefault().getBundle(), new RunnableWithException() {
        public Object run() throws Exception {
          CCWPlugin.getTracer().trace(TraceOptions.CLOJURE_OSGI,"GenericExecutableExtension.create() - with factory: " + factory);
          Object ret = factory.invoke(factoryParams);
          CCWPlugin.getTracer().trace(TraceOptions.CLOJURE_OSGI,"GenericExecutableExtension.create() - factory: " + factory + " returned");
          return ret;
View Full Code Here

    CCWPlugin.getTracer().trace(TraceOptions.LOG_INFO, "create object for bundleclass://" + bundle.getSymbolicName() + "/" + "clojure" + "/" + varAndParams);
    try {
      final String[] parts = varAndParams.split("\\/");
      String var = parts[0] + "/" + parts[1];
      final Var v = BundleUtils.requireAndGetVar(bundle, var);
      return ClojureOSGi.withBundle(bundle, new RunnableWithException() {
        @Override
        public Object run() throws Exception {
          switch (parts.length) {
          case 2: return v.invoke(context);
          case 3: return v.invoke(context, parts[2]);
View Full Code Here

TOP

Related Classes of ccw.util.osgi.RunnableWithException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.