Examples of RunnableWithException


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

Examples of ccw.util.osgi.RunnableWithException

  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

Examples of ccw.util.osgi.RunnableWithException

  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

Examples of ccw.util.osgi.RunnableWithException

    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

Examples of clojure.osgi.RunnableWithException

    if (ns != null) {
      final String callbackFunction = callbackFunctionName(callback, ns);
      final Var var = RT.var(ns, callbackFunction);
            if (var.isBound()) {
        try {
          ClojureOSGi.withBundle(bundle, new RunnableWithException() {
            public Object run() throws Exception {
              if (log != null)
                log.log(LogService.LOG_DEBUG,
                    String.format(
                        "invoking function %s/%s for bundle: %s",
View Full Code Here

Examples of clojure.osgi.RunnableWithException

  private static boolean s_Initialized;

  public static void initialize(final BundleContext aContext) throws Exception {
    if (!s_Initialized) {
      RT.var("clojure.osgi.core", "*clojure-osgi-bundle*", aContext.getBundle());
      withLoader(ClojureOSGi.class.getClassLoader(), new RunnableWithException() {
        public Object run() {
          boolean pushed = false;
         
          try {
            REQUIRE.invoke(Symbol.intern("clojure.main"));
View Full Code Here

Examples of clojure.osgi.RunnableWithException

    }
  }

  public static void require(Bundle aBundle, final String aName) {
    try {
      withBundle(aBundle, new RunnableWithException() {
        public Object run() throws Exception {
          REQUIRE.invoke(Symbol.intern(aName));
          return null;
        }
      });
View Full Code Here

Examples of org.olat.core.util.RunnableWithException

    if (log.isDebug()) {
      log.debug("now disposing controller: " + this.toString());
    }
   
    try {
      ThreadLocalUserActivityLoggerInstaller.runWithUserActivityLoggerWithException(new RunnableWithException() {
        public void run() throws Exception {
            doPreDispose();
            doDispose();
        }
      }, getUserActivityLogger());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.