javax.naming.OperationNotSupportedException Java Examples

The following examples show how to use javax.naming.OperationNotSupportedException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SparkDatasetBoundedSourceVertex.java    From incubator-nemo with Apache License 2.0 6 votes vote down vote up
@Override
protected Iterator<T> initializeIterator() {
  // for setting up the same environment in the executors.
  final SparkSession spark = SparkSession.builder()
    .config(sessionInitialConf)
    .getOrCreate();
  final Dataset<T> dataset;

  try {
    dataset = SparkSession.initializeDataset(spark, commands);
  } catch (final OperationNotSupportedException e) {
    throw new IllegalStateException(e);
  }

  // Spark does lazy evaluation: it doesn't load the full dataset, but only the partition it is asked for.
  final RDD<T> rdd = dataset.sparkRDD();
  final Iterable<T> iterable = () -> JavaConverters.asJavaIteratorConverter(
    rdd.iterator(rdd.getPartitions()[partitionIndex], TaskContext$.MODULE$.empty())).asJava();
  return iterable.iterator();
}
 
Example #2
Source File: GhidraLaunchDelegate.java    From ghidra with Apache License 2.0 6 votes vote down vote up
/**
 * Handles extra things that should happen when we are launching in debug mode.
 */
private static void handleDebugMode() {
	Display.getDefault().asyncExec(() -> {

		// Switch to debug perspective
		if (PlatformUI.getWorkbench() != null) {
			IPerspectiveDescriptor descriptor =
				PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(
					IDebugUIConstants.ID_DEBUG_PERSPECTIVE);
			EclipseMessageUtils.getWorkbenchPage().setPerspective(descriptor);
		}

		// Start PyDev debugger
		if (PyDevUtils.isSupportedPyDevInstalled()) {
			try {
				PyDevUtils.startPyDevRemoteDebugger();
			}
			catch (OperationNotSupportedException e) {
				EclipseMessageUtils.error(
					"Failed to start the PyDev remote debugger.  PyDev version is not supported.");
			}
		}
	});
}
 
Example #3
Source File: PyDevUtils.java    From ghidra with Apache License 2.0 6 votes vote down vote up
/**
 * Checks to see if a supported version of PyDev is installed.
 * 
 * @return True if a supported version of PyDev is installed; otherwise, false.
 */
public static boolean isSupportedPyDevInstalled() {
	try {
		if (PyDevUtilsInternal.isPyDevInstalled()) {
			// Make sure the installed version of PyDev is new enough to support the following
			// operation.
			getJython27InterpreterNames();
			return true;
		}
	}
	catch (OperationNotSupportedException | NoClassDefFoundError e) {
		// Fall through to return false
	}

	return false;
}
 
Example #4
Source File: SparkSession.java    From incubator-nemo with Apache License 2.0 5 votes vote down vote up
/**
 * Method to reproduce the initial Dataset on separate evaluators when reading from sources.
 *
 * @param spark       sparkSession to start from.
 * @param commandList commands required to setup the dataset.
 * @param <T>         type of the resulting dataset's data.
 * @return the initialized dataset.
 * @throws OperationNotSupportedException exception when the command is not yet supported.
 */
public static <T> Dataset<T> initializeDataset(final SparkSession spark,
                                               final LinkedHashMap<String, Object[]> commandList)
  throws OperationNotSupportedException {
  Object result = spark;

  for (Map.Entry<String, Object[]> command : commandList.entrySet()) {
    final String[] cmd = command.getKey().split("#");
    final String className = cmd[0];
    final String methodName = cmd[1];
    final Object[] args = command.getValue();
    final Class<?>[] argTypes = Stream.of(args).map(Object::getClass).toArray(Class[]::new);

    if (!className.contains("SparkSession")
      && !className.contains("DataFrameReader")
      && !className.contains("Dataset")) {
      throw new OperationNotSupportedException(command + " is not yet supported.");
    }

    try {
      final Method method = result.getClass().getDeclaredMethod(methodName, argTypes);
      result = method.invoke(result, args);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }

  return (Dataset<T>) result;
}
 
Example #5
Source File: NamingContext.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
/**
 * Throws a naming exception is Context is not writable.
 * @return <code>true</code> if the Context is writable
 * @throws NamingException if the Context is not writable and
 *  <code>exceptionOnFailedWrite</code> is <code>true</code>
 */
protected boolean checkWritable() throws NamingException {
    if (isWritable()) {
        return true;
    } else {
        if (exceptionOnFailedWrite) {
            throw new javax.naming.OperationNotSupportedException(
                    sm.getString("namingContext.readOnly"));
        }
    }
    return false;
}
 
Example #6
Source File: EnablePythonWizardPage.java    From ghidra with Apache License 2.0 5 votes vote down vote up
/**
 * Validates the fields on the page and updates the page's status.
 * Should be called every time a field on the page changes.
 */
private void validate() {
	String message = null;
	boolean pyDevInstalled = PyDevUtils.isSupportedPyDevInstalled();
	boolean pyDevEnabled = enablePythonCheckboxButton.getSelection();
	boolean comboEnabled = pyDevInstalled && pyDevEnabled;

	if (pyDevEnabled) {
		if (!pyDevInstalled) {
			message = "PyDev version " + PyDevUtils.MIN_SUPPORTED_VERSION +
				" or later is not installed.";
		}
		else {
			try {
				List<String> interpreters = PyDevUtils.getJython27InterpreterNames();
				if (interpreters.isEmpty()) {
					message = "No Jython interpreters found.  Click the + button to add one.";
				}
			}
			catch (OperationNotSupportedException e) {
				message = "PyDev version is not supported.";
				comboEnabled = false;
			}
		}
	}

	jythonCombo.setEnabled(comboEnabled);
	addJythonButton.setEnabled(comboEnabled);

	setErrorMessage(message);
	setPageComplete(message == null);
}
 
Example #7
Source File: PyDevUtils.java    From ghidra with Apache License 2.0 5 votes vote down vote up
/**
 * Gets a list of discovered Jython 2.7 interpreter names.
 *  
 * @return a list of discovered Jython 2.7 interpreter names.
 * @throws OperationNotSupportedException if PyDev is not installed or it does not support this 
 *   operation.
 */
public static List<String> getJython27InterpreterNames() throws OperationNotSupportedException {
	try {
		return PyDevUtilsInternal.getJython27InterpreterNames();
	}
	catch (NoClassDefFoundError | NoSuchMethodError e) {
		throw new OperationNotSupportedException(e.getMessage());
	}
}
 
Example #8
Source File: PyDevUtils.java    From ghidra with Apache License 2.0 5 votes vote down vote up
/**
 * Adds the given Jython interpreter to PyDev.
 * 
 * @param interpreterName The name of the interpreter to add.
 * @param interpreterFile The interpreter file to add.
 * @param interpreterLibDir The interpreter library directory to add.
 * @throws OperationNotSupportedException if PyDev is not installed or it does not support this 
 *   operation.
 */
public static void addJythonInterpreter(String interpreterName, File interpreterFile,
		File interpreterLibDir)
		throws OperationNotSupportedException {
	try {
		PyDevUtilsInternal.addJythonInterpreter(interpreterName, interpreterFile,
			interpreterLibDir);
	}
	catch (NoClassDefFoundError | NoSuchMethodError e) {
		throw new OperationNotSupportedException(e.getMessage());
	}
}
 
Example #9
Source File: PyDevUtils.java    From ghidra with Apache License 2.0 5 votes vote down vote up
/**
 * Starts the PyDev remote debugger.
 * 
 * @throws OperationNotSupportedException if PyDev is not installed or it does not support this 
 *   operation.
 */
public static void startPyDevRemoteDebugger() throws OperationNotSupportedException {
	try {
		PyDevUtilsInternal.startPyDevRemoteDebugger();
	}
	catch (NoClassDefFoundError | NoSuchMethodError e) {
		throw new OperationNotSupportedException(e.getMessage());
	}
}
 
Example #10
Source File: EnablePythonWizardPage.java    From ghidra with Apache License 2.0 5 votes vote down vote up
/**
 * Populates the Jython combo box with discovered Jython names.
 */
private void populateJythonCombo() {
	jythonCombo.removeAll();
	try {
		for (String jythonName : PyDevUtils.getJython27InterpreterNames()) {
			jythonCombo.add(jythonName);
		}
	}
	catch (OperationNotSupportedException e) {
		// Nothing to do.  Combo should and will be empty.
	}
	if (jythonCombo.getItemCount() > 0) {
		jythonCombo.select(0);
	}
}
 
Example #11
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public void destroySubcontext(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #12
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public NameParser getNameParser(String name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #13
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public NameParser getNameParser(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #14
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public String getNameInNamespace() throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #15
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public Name composeName(Name name, Name prefix) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #16
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public NameParser getNameParser(String name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #17
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public NameParser getNameParser(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #18
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public String getNameInNamespace() throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #19
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public void destroySubcontext(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #20
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public Context createSubcontext(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #21
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public void rename(Name oldName, Name newName) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #22
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public void rebind(Name name, Object obj) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #23
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public void unbind(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #24
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public void bind(Name name, Object obj) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #25
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public Object lookupLink(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #26
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public Object lookup(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #27
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public NamingEnumeration<Binding> listBindings(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #28
Source File: SimpleNamingContext.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public NamingEnumeration<NameClassPair> list(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #29
Source File: SimpleNamingContext.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
public Context createSubcontext(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
Example #30
Source File: LockDeviceRESTHandler.java    From arcusplatform with Apache License 2.0 4 votes vote down vote up
@Override
protected MessageBody doHandle(ClientMessage request) throws Exception {
   return Errors.fromException(new OperationNotSupportedException());
}