/*******************************************************************************
*
* Copyright (c) 2011, Oracle Corporation.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
*
* Winston Prakash
*
*******************************************************************************/
package org.eclipse.hudson.jna;
import hudson.DescriptorExtensionList;
import hudson.ExtensionPoint;
import hudson.model.AbstractDescribableImpl;
import hudson.model.Descriptor;
import hudson.model.Hudson;
import java.io.Serializable;
import java.util.List;
/**
* Extension point for adding Native Mac Support to Hudson
*
* <p> This object can have an optional <tt>config.jelly</tt> to configure the
* Native Access Support <p> A default constructor is needed to create
* NativeAccessSupport in the default configuration.
*
* @author Winston Prakash
* @since 3.0.0
* @see NativeAccessSupportDescriptor
*/
public abstract class NativeMacSupport extends AbstractDescribableImpl<NativeMacSupport> implements ExtensionPoint,
Serializable {
/**
* Returns all the registered {@link NativeAccessSupport} descriptors.
*/
public static DescriptorExtensionList<NativeMacSupport, Descriptor<NativeMacSupport>> all() {
return Hudson.getInstance().<NativeMacSupport, Descriptor<NativeMacSupport>>getDescriptorList(NativeMacSupport.class);
}
@Override
public NativeMacSupportDescriptor getDescriptor() {
return (NativeMacSupportDescriptor) super.getDescriptor();
}
/**
* Check if this Extension has Support for specific native Operation
*
* @param nativeFunc Native Operation
* @return true if supported
*/
abstract public boolean hasSupportFor(NativeFunction nativeFunc);
/**
* Get the error associated with the last Operation
*
* @return String error message
*/
abstract public String getLastError();
/**
* Get the Native processes of a Mac System
*
* @return
* @throws hudson.util.jna.Native.NativeExecutionException
*/
abstract public List<NativeProcess> getMacProcesses() throws NativeAccessException;
}