Example usage for java.lang IllegalAccessError IllegalAccessError

List of usage examples for java.lang IllegalAccessError IllegalAccessError

Introduction

In this page you can find the example usage for java.lang IllegalAccessError IllegalAccessError.

Prototype

public IllegalAccessError(String s) 

Source Link

Document

Constructs an IllegalAccessError with the specified detail message.

Usage

From source file:com.android.deskclock.Utils.java

public static void enforceNotMainLooper() {
    if (Looper.getMainLooper() == Looper.myLooper()) {
        throw new IllegalAccessError("May not call from main thread.");
    }// w  w  w  . j  a va  2s. c o  m
}

From source file:net.modelbased.proasense.storage.registry.RestRequest.java

public static String putData(URI uri, String data) {
    URI target = null;/*ww  w .jav a2s .c o  m*/
    try {
        target = new URI(uri.toString() + DISPATCHER_PATH);
    } catch (URISyntaxException e1) {
        e1.printStackTrace();
    }
    HttpClient client = new DefaultHttpClient();
    HttpPut request = new HttpPut(target);
    request.setHeader("Content-type", "application/json");
    String response = null;
    try {
        StringEntity seContent = new StringEntity(data);
        seContent.setContentType("text/json");
        request.setEntity(seContent);
        response = resolveResponse(client.execute(request));
    } catch (Exception e) {
        e.printStackTrace();
    }
    if (response.trim().length() > 2) {
        throw new IllegalAccessError("Sensor not registred: " + response);
    }
    return response;
}

From source file:org.apache.gora.dynamodb.store.DynamoDBNativeStore.java

/**
 * Deletes items using a specific query//from  w  w  w . jav  a  2  s.c om
 *
 * @param query matching records to this query will be deleted
 * @return
 */
@Override
@SuppressWarnings("unchecked")
public long deleteByQuery(Query<K, T> query) {
    // TODO verify whether or not we are deleting a whole row
    // String[] fields = getFieldsToQuery(query.getFields());
    // find whether all fields are queried, which means that complete
    // rows will be deleted
    // boolean isAllFields = Arrays.equals(fields
    // , getBeanFactory().getCachedPersistent().getFields());
    Result<K, T> result = execute(query);
    ArrayList<T> deletes = new ArrayList<T>();
    try {
        while (result.next()) {
            T resultObj = result.get();
            deletes.add(resultObj);

            @SuppressWarnings("rawtypes")
            DynamoDBKey dKey = new DynamoDBKey();

            dKey.setHashKey(getHashFromObj(resultObj));

            dKey.setRangeKey(getRangeKeyFromObj(resultObj));
            delete((K) dKey);
        }
    } catch (IllegalArgumentException e) {
        LOG.error("Illegal argument detected", e.getMessage());
        throw new IllegalArgumentException(e);
    } catch (IllegalAccessException e) {
        LOG.error("Illegal access detected", e.getMessage());
        throw new IllegalAccessError(e.getMessage());
    } catch (InvocationTargetException e) {
        LOG.error(e.getMessage());
        throw new RuntimeException(e);
    } catch (Exception e) {
        LOG.error(e.getMessage());
        throw new RuntimeException(e);
    }
    return deletes.size();
}

From source file:com.marketplace.io.SessionManager.java

/**
 * Gets the <code>Session</code> object corresponding to the passed
 * parameter./*  ww w .jav  a 2 s . c o m*/
 * 
 * @param apiLevel
 * @return
 * @throws SessionUnavailableException
 */
public Session getSession(int apiLevel) throws SessionUnavailableException {

    if ((apiLevel < 1) || (apiLevel > (sessions.length + 1))) {
        throw new IllegalAccessError("Android API Level " + apiLevel + " is not supported by this library.");
    }

    refreshSessions();

    for (Session session : sessions) {
        if (session.getDevice().getDeviceVersion() >= apiLevel) {
            return session;
        }
    }

    throw new SessionUnavailableException("Session for api level " + apiLevel + " is not available");
}

From source file:org.globus.workspace.groupauthz.GroupAuthz.java

public void setGroup16(String nope) {
    throw new IllegalAccessError("Only support for 15 groups right now");
}

From source file:com.baidu.cc.web.rpc.ConfigServerServiceImpl.java

/**
 * To authenticate by user and password. if authentication failed throw<br>
 * {@link IllegalAccessError} exception.
 * /*from ww w.  j  a  v  a 2s.  c  om*/
 * @param user
 *            user name
 * @param password
 *            password
 * @return {@link User} object
 * @throws IllegalAccessError
 *             if authentication failed.
 */
protected User authenticate(String user, String password) throws IllegalAccessError {

    User u = userService.getByName(user);
    if (u == null) {
        throw new IllegalAccessError("User '" + user + " not exist.");
    }

    String passwordToCheck = u.getApiPassword();
    if (passwordToCheck == null) {
        if (password == null) {
            return u;
        } else {
            throw new IllegalAccessError("User '" + user + "' authenticate failed.");
        }
    }

    String plain = encryptor.decrypt(password);
    String md5 = Security.MD5Encode(plain);
    boolean result = u.getApiPassword().equals(md5);

    if (!result) {
        throw new IllegalAccessError("User '" + user + "' authenticate failed.");
    }

    return u;
}

From source file:edu.umass.cs.msocket.common.policies.RandomProxyPolicy.java

@Override
public List<String> getProxyIPs(List<ProxyStatusInfo> proxies, Socket acceptedSocket) {
    throw new IllegalAccessError("Random proxy policies should not be sent to the location service");
}

From source file:org.sakaiproject.component.common.type.TypeManagerImpl.java

public void saveType(Type type) {
    if (LOG.isDebugEnabled()) {
        LOG.debug("saveType(Type " + type + ")");
    }// ww  w  .j a  v  a  2 s .co m
    if (type == null)
        throw new IllegalArgumentException("type");

    if (type instanceof TypeImpl) { // found well known Type
        TypeImpl ti = (TypeImpl) type;
        persistableHelper.modifyPersistableFields(ti);
        getHibernateTemplate().saveOrUpdate(ti);
    } else { // found external Type
        throw new IllegalAccessError("Alternate Type implementations not supported yet.");
    }
}

From source file:org.onecmdb.core.internal.session.Session.java

public UserDetails getPrincipal() {
    Object object = getAuthorization().getPrincipal();
    if (object instanceof UserDetails) {
        return ((UserDetails) object);
    }/*from   ww  w.  j a  va2  s . com*/
    throw new IllegalAccessError("No UserDetails found!");
}

From source file:com.jbrisbin.vcloud.cache.RabbitMQAsyncCache.java

@Override
public void setParent(String childId, String parentId) {
    throw new IllegalAccessError("This method is not yet implemented");
}