Examples of InvocationTargetException


Examples of com.sun.star.reflection.InvocationTargetException

            if (!editable)
            {
                NoSupportException nse = new NoSupportException(
                    aFunctionName + " is not editable " );

                throw new InvocationTargetException(
                    "Scripting framework error editing script", null, nse );
            }

            XScriptContext ctxt =  provider.getScriptingContext();
            ScriptMetaData data = null;
            try
            {
                data = (ScriptMetaData)parent.getByName( name );
            }
            catch ( NoSuchElementException nse )
            {
                throw new com.sun.star.lang.IllegalArgumentException(
                    name + " does not exist or can't be found " );
            }
            catch com.sun.star.lang.WrappedTargetException wte )
            {
                // rethrow
                throw new InvocationTargetException(
                    "Scripting framework editing script ",
                        null, wte.TargetException );
            }

            provider.getScriptEditor().edit(ctxt, data);
        }
        else if (aFunctionName.equals("Deletable"))
        {
            if (!deletable)
            {
                NoSupportException nse = new NoSupportException(
                    aFunctionName + " is not supported for this node" );

                throw new InvocationTargetException(
                      "Scripting framework error deleting script", null, nse );
            }
            try
            {
                parent.removeByName( name );
                result = new Any(new Type(Boolean.class), Boolean.TRUE);
            }
            catch ( NoSuchElementException nse )
            {
                throw new com.sun.star.lang.IllegalArgumentException(
                    name + " does not exist or can't be found " );
            }
            catch ( WrappedTargetException wte )
            {
                // rethrow
                throw new InvocationTargetException(
                    "Scripting framework deleting script ",
                        null, wte.TargetException );
            }

        }
        else if (aFunctionName.equals("Renamable"))
        {
            result = new Any(new Type(XBrowseNode.class), new XBrowseNode[0]);
            if (!renamable)
            {
                NoSupportException nse = new NoSupportException(
                    aFunctionName + " is not supported for this node" );

                throw new InvocationTargetException(
                    "Scripting framework error renaming script", null, nse );
            }

            try
            {
                String newName = (String) AnyConverter.toString(aParams[0]);
                ScriptMetaData oldData = (ScriptMetaData)parent.getByName( name );
                oldData.loadSource();
                String oldSource = oldData.getSource();

                LogUtils.DEBUG("Create renamed script");
                String languageName =
                    newName + "." + provider.getScriptEditor().getExtension();
                String language = provider.getName();

                ScriptEntry entry = new ScriptEntry(
                    language, languageName, languageName, "", new HashMap() );

                ScriptMetaData data = new ScriptMetaData(
                    parent, entry, oldSource );

                parent.insertByName( languageName, data );

                LogUtils.DEBUG("Now remove old script");
                parent.removeByName( name );

                uri = data.getShortFormScriptURL();
                name = languageName;
                result = new Any(new Type(XBrowseNode.class), this);
            }
            catch ( NoSuchElementException nse )
            {
                throw new com.sun.star.lang.IllegalArgumentException(
                    name + " does not exist or can't be found " );
            }
            catch ( ElementExistException eee )
            {
                // rethrow
                throw new InvocationTargetException(
                    "Scripting framework error renaming script ",
                        null, eee );
            }
            catch ( WrappedTargetException wte )
            {
                // rethrow
                throw new InvocationTargetException(
                    "Scripting framework rename script ",
                        null, wte.TargetException );
            }
        }
        else {
View Full Code Here

Examples of java.lang.reflect.InvocationTargetException

      public void run(IProgressMonitor monitor) throws InvocationTargetException {
        try {
          doFinish(runtimeName, deployment, monitor, selectedWorkingSets);
        } catch (CoreException e) {
          WGADesignerPlugin.getDefault().logError(e.getMessage(), e);         
          throw new InvocationTargetException(e);
        } finally {
          monitor.done();
        }
      }
    };
View Full Code Here

Examples of java.lang.reflect.InvocationTargetException

          dataSources.add(new FileDataSource(tmpFile));
          try {
            current.getServices().installPlugins(current.getSession(), dataSources);
            monitor.worked(1);
          } catch (WGAServiceException e) {           
            throw new InvocationTargetException(e, "Plugin export to server '" + current.getName() + " (" + current.getUrl() + ") failed.");
          }         
          if (monitor.isCanceled()) {
            break;
          }
        }
      } catch (Exception e) {
        if (e instanceof InvocationTargetException) {
          throw (InvocationTargetException) e;
        } else if (e instanceof InterruptedException) {
          throw (InterruptedException) e;
        } else {
          throw new InvocationTargetException(e, "Upload of plugin failed.");
        }
      } finally {
        monitor.done();
        tmpFile.delete();
      }
View Full Code Here

Examples of java.lang.reflect.InvocationTargetException

        if (e instanceof SQLException) {
            return (SQLException) e;
        }
        String message;
        if (e instanceof InvocationTargetException) {
            InvocationTargetException te = (InvocationTargetException) e;
            Throwable t = te.getTargetException();
            if (t instanceof SQLException) {
                return (SQLException) t;
            }
            message = "Invocation exception";
        } else if (e instanceof IOException) {
View Full Code Here

Examples of java.lang.reflect.InvocationTargetException

                }             
              }
            }
           
          } catch (Exception e) {
            throw new InvocationTargetException(e);
          }       
        } else if (info instanceof WGAPluginResourceSyncInfo) {
            try {
                WGAPluginResourceSyncInfo wgaSyncInfo = (WGAPluginResourceSyncInfo) info;
                if ((wgaSyncInfo.getKind() & SyncInfo.CONFLICTING) != SyncInfo.CONFLICTING) {
                    int change = SyncInfo.getChange(wgaSyncInfo.getKind());
                            if (change == SyncInfo.DELETION) {
                                WGARemoteServer remote = wgaSyncInfo.getServer();
                                remote.getServices().deactivatePlugin(remote.getSession(), ((WGAPluginResourceVariant)wgaSyncInfo.getRemote()).getPluginInfo());    
                                committedResources.add(wgaSyncInfo.getLocal());
                            } else if (change == SyncInfo.ADDITION) {
                                WGARemoteServer local = wgaSyncInfo.getRuntime().createRemoteServer();
                                local.connectToServer();
                                DataSource plugin = local.getServices().downloadPlugin(local.getSession(), wgaSyncInfo.getLocalPluginInfo());
                                WGARemoteServer remote = wgaSyncInfo.getServer();
                                remote.getServices().installPlugins(remote.getSession(), Collections.singletonList(plugin));
                                remote.getServices().activatePlugin(remote.getSession(), wgaSyncInfo.getLocalPluginInfo());
                                committedResources.add(wgaSyncInfo.getLocal());
                            }
                } 
            } catch (Exception e) {
                throw new InvocationTargetException(e);                   
            }
        }
      }
      if (_configuration.getParticipant() instanceof SubscriberParticipant) {
        Subscriber subscriber = ((SubscriberParticipant)_configuration.getParticipant()).getSubscriber();
        try {
          subscriber.refresh(committedResources.toArray(new IResource[0]), IResource.DEPTH_INFINITE, new SubProgressMonitor(monitor, -1));
        } catch (TeamException e) {
          throw new InvocationTargetException(e);
        }
      }
    } finally {
      monitor.done();
   
View Full Code Here

Examples of java.lang.reflect.InvocationTargetException

            octx.setReturn(ret);
        } catch (InvocationTargetException e) {
            throw e;
        } catch (Exception e) {
            throw new InvocationTargetException(e);
        } finally {
            if (impl == null) {
                endpoint.releaseImplementor(o);
            }
        }
View Full Code Here

Examples of java.lang.reflect.InvocationTargetException

            lock.wait();
        }

        Throwable eventThrowable = event.getThrowable();
        if (eventThrowable != null) {
            throw new InvocationTargetException(eventThrowable);
        }
    }
View Full Code Here

Examples of java.lang.reflect.InvocationTargetException

              links.addAll(RegExUtils.extractLinksFromText(content, false));

            /* Check Links for valid Feeds */
            importFromLinksBruteforce(links, monitor);
          } catch (Exception e) {
            throw new InvocationTargetException(e);
          } finally {
            fCurrentProgressMonitor = null;
            monitor.done();

            /* Close Reader */
            if (reader != null) {
              try {
                reader.close();
              } catch (IOException e) {
                throw new InvocationTargetException(e);
              }
            }
          }
        }
      };
View Full Code Here

Examples of java.lang.reflect.InvocationTargetException

            }
          }

          /* Rethrow Exception */
          if (showError[0])
            throw new InvocationTargetException(e);
        } finally {

          /* Reset Field in case of error or cancellation */
          if (canceled || error != null)
            fCurrentProgressMonitor = null;

          /* Close Input Stream */
          if (in != null) {
            try {
              if ((canceled || error != null) && in instanceof IAbortable)
                ((IAbortable) in).abort();
              else
                in.close();
            } catch (IOException e) {
              throw new InvocationTargetException(e);
            }
          }
        }

        /* Scan remote Resource for Links and valid Feeds */
        if (bruteForce && !monitor.isCanceled() && !Controller.getDefault().isShuttingDown()) {
          try {
            importFromOnlineResourceBruteforce(link, monitor, false, false);
          } catch (Exception e) {
            throw new InvocationTargetException(e);
          } finally {
            fCurrentProgressMonitor = null;
          }
        }

View Full Code Here

Examples of java.lang.reflect.InvocationTargetException

          }
        }

        /* Error finding a Handler for the Link - Rethrow */
        catch (Exception e) {
          throw new InvocationTargetException(e);
        } finally {

          /* Reset Field in case of error or cancellation */
          if (canceled || error != null)
            fCurrentProgressMonitor = null;

          /* Close Input Stream */
          if (in != null) {
            try {
              if ((canceled || error != null) && in instanceof IAbortable)
                ((IAbortable) in).abort();
              else
                in.close();
            } catch (IOException e) {
              throw new InvocationTargetException(e);
            }
          }
        }

        /* Done */
 
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.