List of usage examples for java.lang IllegalAccessException getMessage
public String getMessage()
From source file:org.specrunner.util.functions.core.PredicateProperty.java
@Override public Boolean apply(P p) { try {/*from www.ja va2 s . c o m*/ Object tmp = PropertyUtils.getProperty(p, property); return tmp == null ? value == null : tmp.equals(value); } catch (IllegalAccessException e) { if (UtilLog.LOG.isTraceEnabled()) { UtilLog.LOG.trace(e.getMessage(), e); } } catch (InvocationTargetException e) { if (UtilLog.LOG.isTraceEnabled()) { UtilLog.LOG.trace(e.getMessage(), e); } } catch (NoSuchMethodException e) { if (UtilLog.LOG.isTraceEnabled()) { UtilLog.LOG.trace(e.getMessage(), e); } } return Boolean.FALSE; }
From source file:de.highbyte_le.weberknecht.request.actions.DynamicActionFactory.java
/** * creates new instance for requested action * @param actionName// w w w .j a v a 2 s .c o m * @return new instance of action */ @Override public ExecutableAction createAction(String actionName) throws ActionInstantiationException { try { Class<? extends ExecutableAction> actionClass = actionMap.get(actionName); if (actionClass != null) return actionClass.newInstance(); } catch (IllegalAccessException e) { log.error("createAction() - IllegalAccessException: " + e.getMessage(), e); } catch (InstantiationException e) { log.error("createAction() - InstantiationException: " + e.getMessage(), e); } catch (Exception e) { throw new ActionInstantiationException(e.getMessage(), e); } return null; }
From source file:pl.bristleback.server.bristle.conf.resolver.message.ObjectSenderInjector.java
private void injectProperty(Object bean, Field field, ConditionObjectSender objectSender) { try {//from w w w . j ava2 s . c om FieldUtils.writeDeclaredField(bean, field.getName(), objectSender, true); } catch (IllegalAccessException e) { throw new BeanInstantiationException(bean.getClass(), e.getMessage(), e); } }
From source file:com.oltpbenchmark.benchmarks.auctionmark.util.LoaderItemInfo.java
@Override public String toString() { Class<?> hints_class = this.getClass(); ListOrderedMap<String, Object> m = new ListOrderedMap<String, Object>(); for (Field f : hints_class.getDeclaredFields()) { String key = f.getName().toUpperCase(); Object val = null; try {// w ww .j a va 2s .co m val = f.get(this); } catch (IllegalAccessException ex) { val = ex.getMessage(); } m.put(key, val); } // FOR return (StringUtil.formatMaps(m)); }
From source file:fr.paris.lutece.plugins.contextinclude.service.parameter.ContextParameterService.java
/** * {@inheritDoc}//w ww .ja va 2s .c om */ @Override public IContextParameter find() { Map<String, Object> mapParameters = _contextParameterDAO.load(ContextIncludePlugin.getPlugin()); if (mapParameters != null) { try { BeanUtils.populate(_contextParameter, mapParameters); } catch (IllegalAccessException e) { AppLogService.error(e.getMessage(), e); } catch (InvocationTargetException e) { AppLogService.error(e.getMessage(), e); } } return _contextParameter; }
From source file:com.cairone.sdlpoc.datasources.InMemoryDataSourceProvider.java
@Override public QueryOperationStrategy getStrategy(ODataRequestContext oDataRequestContext, QueryOperation queryOperation, TargetType targetType) throws ODataException { StrategyBuilder builder = new StrategyBuilder(); List<Predicate<Person>> predicateList = builder.buildCriteria(queryOperation, oDataRequestContext); int limit = builder.getLimit(); int skip = builder.getSkip(); List<String> propertyNames = builder.getPropertyNames(); return () -> { LOG.debug("Executing query against in memory data"); Stream<Person> personStream = inMemoryDataSource.getPersonConcurrentMap().values().stream(); List<Person> filteredPersons = personStream.filter(p -> predicateList.stream().allMatch(f -> f.test(p))) .collect(Collectors.toList()); long count = 0; if (builder.isCount() || builder.includeCount()) { count = filteredPersons.size(); LOG.debug("Counted {} persons matching query", count); if (builder.isCount()) { return QueryResult.from(count); }/* w ww . ja v a2 s. c o m*/ } if (skip != 0 || limit != Integer.MAX_VALUE) { filteredPersons = filteredPersons.stream().skip(skip).limit(limit).collect(Collectors.toList()); } LOG.debug("Found {} persons matching query", filteredPersons.size()); if (propertyNames != null && !propertyNames.isEmpty()) { try { LOG.debug("Selecting {} properties of person", propertyNames); return QueryResult .from(EdmUtil.getEdmPropertyValue(filteredPersons.get(0), propertyNames.get(0))); } catch (IllegalAccessException e) { LOG.error(e.getMessage(), e); return QueryResult.from(Collections.emptyList()); } } QueryResult result = QueryResult.from(filteredPersons); if (builder.includeCount()) { result = result.withCount(count); } return result; }; }
From source file:org.cloudifysource.esc.driver.provisioning.PersistentMachineDetails.java
/************** * Creates a new machine details object from the current persistent details. Unsafe properties are re-created. * //from ww w. j ava 2 s .co m * @return the machine details. **/ public MachineDetails toMachineDetails() { final MachineDetails md = new MachineDetails(); try { PropertyUtils.copyProperties(md, this); } catch (IllegalAccessException e) { throw new IllegalStateException("Failed to create machine details: " + e.getMessage(), e); } catch (InvocationTargetException e) { throw new IllegalStateException("Failed to create machine details: " + e.getMessage(), e); } catch (NoSuchMethodException e) { throw new IllegalStateException("Failed to create machine details: " + e.getMessage(), e); } if (this.getKeyFileName() != null) { final File keyFile = new File(this.getKeyFileName()); md.setKeyFile(keyFile); } return md; }
From source file:com.orange.mmp.api.ws.jsonrpc.SimpleMapSerializer.java
@SuppressWarnings("unchecked") @Override/* w w w .j a v a 2s . c o m*/ public Object unmarshall(SerializerState state, Class clazz, Object o) throws UnmarshallException { Map map = null; try { try { try { if (clazz.isInterface()) { map = new java.util.HashMap(); } else map = (Map) clazz.newInstance(); } catch (ClassCastException cce) { throw new UnmarshallException("invalid unmarshalling Class " + cce.getMessage()); } } catch (IllegalAccessException iae) { throw new UnmarshallException("no access unmarshalling object " + iae.getMessage()); } } catch (InstantiationException ie) { throw new UnmarshallException("unable to instantiate unmarshalling object " + ie.getMessage()); } JSONObject jso = (JSONObject) o; Iterator keys = jso.keys(); state.setSerialized(o, map); try { while (keys.hasNext()) { String key = (String) keys.next(); map.put(key, ser.unmarshall(state, null, jso.get(key))); } } catch (JSONException je) { throw new UnmarshallException("Could not read map: " + je.getMessage()); } return map; }
From source file:nz.co.senanque.messaging.OrderReplyEndpoint.java
public void issueResponseFor(Message<org.w3c.dom.Document> orderResponse) { log.debug("processed orderResponse: correlationId {}", orderResponse.getHeaders().get(IntegrationMessageHeaderAccessor.CORRELATION_ID, Long.class)); org.w3c.dom.Document doc = orderResponse.getPayload(); Document document = new DOMBuilder().build(doc); Element root = document.getRootElement(); Order context = new Order(); @SuppressWarnings("unchecked") Iterator<Text> itr = (Iterator<Text>) root .getDescendants(new ContentFilter(ContentFilter.TEXT | ContentFilter.CDATA)); while (itr.hasNext()) { Text text = itr.next();// w w w.j a va 2s . c o m log.debug("name {} value {}", text.getParentElement().getName(), text.getValue()); String name = getName(text); try { Class<?> targetType = PropertyUtils.getPropertyType(context, name); Object value = ConvertUtils.convert(text.getValue(), targetType); PropertyUtils.setProperty(context, name, value); } catch (IllegalAccessException e) { // Ignore these and move on log.debug("{} {}", name, e.getMessage()); } catch (InvocationTargetException e) { // Ignore these and move on log.debug("{} {}", name, e.getMessage()); } catch (NoSuchMethodException e) { // Ignore these and move on log.debug("{} {}", name, e.getMessage()); } } }
From source file:org.cloudifysource.esc.driver.provisioning.PersistentMachineDetails.java
/****** * Populates the fields of the current object from the given MachineDetails. Note that all copy operations are * shallow. Unsafe properties will be replaced. * // w w w.ja v a 2 s . com * @param md * the machine detaions to copy. */ public void populateFromMachineDetails(final MachineDetails md) { try { PropertyUtils.copyProperties(this, md); } catch (IllegalAccessException e) { throw new IllegalStateException("Failed to create persistent machine details: " + e.getMessage(), e); } catch (InvocationTargetException e) { throw new IllegalStateException("Failed to create persistent machine details: " + e.getMessage(), e); } catch (NoSuchMethodException e) { throw new IllegalStateException("Failed to create persistent machine details: " + e.getMessage(), e); } if (this.getKeyFile() != null) { this.setKeyFileName(this.getKeyFile().getAbsolutePath()); this.setKeyFile(null); } }