类javax.naming.OperationNotSupportedException源码实例Demo

下面列出了怎么用javax.naming.OperationNotSupportedException的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: ghidra   文件: PyDevUtils.java
/**
 * 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;
}
 
源代码2 项目: ghidra   文件: GhidraLaunchDelegate.java
/**
 * 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.");
			}
		}
	});
}
 
@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();
}
 
源代码4 项目: Tomcat8-Source-Read   文件: NamingContext.java
/**
 * 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;
}
 
源代码5 项目: ghidra   文件: PyDevUtils.java
/**
 * 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());
	}
}
 
源代码6 项目: ghidra   文件: PyDevUtils.java
/**
 * 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());
	}
}
 
源代码7 项目: ghidra   文件: PyDevUtils.java
/**
 * 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());
	}
}
 
源代码8 项目: ghidra   文件: EnablePythonWizardPage.java
/**
 * 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);
}
 
源代码9 项目: ghidra   文件: EnablePythonWizardPage.java
/**
 * 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);
	}
}
 
源代码10 项目: incubator-nemo   文件: SparkSession.java
/**
 * 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;
}
 
源代码11 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public NamingEnumeration<NameClassPair> list(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码12 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public NamingEnumeration<Binding> listBindings(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码13 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public Object lookup(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码14 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public Object lookupLink(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码15 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public void bind(Name name, Object obj) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码16 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public void unbind(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码17 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public void rebind(Name name, Object obj) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码18 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public void rename(Name oldName, Name newName) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码19 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public Context createSubcontext(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码20 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public void destroySubcontext(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码21 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public String getNameInNamespace() throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码22 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public NameParser getNameParser(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码23 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public NameParser getNameParser(String name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码24 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public Name composeName(Name name, Name prefix) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码25 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public NamingEnumeration<NameClassPair> list(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码26 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public NamingEnumeration<Binding> listBindings(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码27 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public Object lookup(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码28 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public Object lookupLink(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码29 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public void bind(Name name, Object obj) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
源代码30 项目: spring-analysis-note   文件: SimpleNamingContext.java
@Override
public void unbind(Name name) throws NamingException {
	throw new OperationNotSupportedException("SimpleNamingContext does not support [javax.naming.Name]");
}
 
 类所在包
 同包方法