List of usage examples for java.lang IllegalAccessException IllegalAccessException
public IllegalAccessException()
IllegalAccessException
without a detail message. From source file:org.ambraproject.action.debug.ProcessDumpAction.java
@Override public String execute() throws Exception { if (!checkAccess()) { throw new IllegalAccessException(); }/*from ww w .j av a 2 s .c o m*/ PrintWriter writer = ServletActionContext.getResponse().getWriter(); String dump = getProcessDump(); for (String s : dump.split("\n")) { writer.println(s); } return null; }
From source file:com.teamcodeflux.android.RestTemplateFactory.java
private RestTemplateFactory() throws Exception { throw new IllegalAccessException(); }
From source file:jp.terasoluna.fw.util.ConvertUtil_PropertyUtilsBeanStub01.java
/** * ?IllegalAccessException?// ww w .j av a2s .com * @param bean Bean whose properties are to be extracted */ @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public Map describe(Object bean) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { throw new IllegalAccessException(); }
From source file:jp.terasoluna.fw.util.GenericPropertyUtil_PropertyUtilsBeanStub01.java
/** * ?IllegalAccessException?//from www. j a v a2 s.co m * * @param bean * Bean for which a property descriptor is requested * @param name * Possibly indexed and/or nested name of the property for which * a property descriptor is requested */ @Override public PropertyDescriptor getPropertyDescriptor(Object bean, String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { throw new IllegalAccessException(); }
From source file:org.jtransfo.internal.NewInstanceObjectFinderTest.java
@Test public void testIllegalAccessException() throws Exception { when(reflectionHelper.newInstance(SimpleClassDomain.class)).thenThrow(new IllegalAccessException()); exception.expect(JTransfoException.class); exception.expectMessage("Cannot create instance for domain class org.jtransfo.object.SimpleClassDomain."); newInstanceObjectFinder.getObject(SimpleClassDomain.class, new SimpleClassNameTo()); }
From source file:egovframework.rte.fdl.string.EgovObjectUtil.java
/** * ? ? ? ./*from www .jav a 2 s . c o m*/ * @param className * @return * @throws ClassNotFoundException * @throws InstantiationException * @throws IllegalAccessException * @throws Exception */ public static Object instantiate(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, Exception { Class<?> clazz; try { clazz = loadClass(className); return clazz.newInstance(); } catch (ClassNotFoundException e) { if (log.isErrorEnabled()) log.error(className + " : Class is can not instantialized."); throw new ClassNotFoundException(); } catch (InstantiationException e) { if (log.isErrorEnabled()) log.error(className + " : Class is can not instantialized."); throw new InstantiationException(); } catch (IllegalAccessException e) { if (log.isErrorEnabled()) log.error(className + " : Class is not accessed."); throw new IllegalAccessException(); } catch (Exception e) { if (log.isErrorEnabled()) log.error(className + " : Class is not accessed."); throw new Exception(e); } }
From source file:org.logicblaze.lingo.jms.JmsRemotingTest.java
public void testJmsProxyFactoryBeanAndServiceExporter() throws Throwable { TestBean target = new TestBean("myname", 99); exporter = new JmsServiceExporter(); exporter.setServiceInterface(ITestBean.class); exporter.setService(target);// ww w .jav a 2 s.co m configure(exporter); subscribeToQueue(exporter, getDestinationName()); pfb = new JmsProxyFactoryBean(); pfb.setServiceInterface(ITestBean.class); pfb.setServiceUrl("http://myurl"); pfb.setRequestor(createRequestor(getDestinationName())); configure(pfb); ITestBean proxy = (ITestBean) pfb.getObject(); assertEquals("myname", proxy.getName()); assertEquals(99, proxy.getAge()); proxy.setAge(50); System.out.println("getting name: " + proxy.getName()); int age = proxy.getAge(); System.out.println("got age: " + age); assertEquals("myname", proxy.getName()); assertEquals(50, proxy.getAge()); try { proxy.exceptional(new IllegalStateException()); fail("Should have thrown IllegalStateException"); } catch (IllegalStateException ex) { // expected } try { proxy.exceptional(new IllegalAccessException()); fail("Should have thrown IllegalAccessException"); } catch (IllegalAccessException ex) { // expected } }
From source file:org.bytesoft.bytetcc.supports.springcloud.SpringCloudCoordinator.java
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Class<?> clazz = method.getDeclaringClass(); String methodName = method.getName(); if (Object.class.equals(clazz)) { return method.invoke(this, args); } else if (RemoteCoordinator.class.equals(clazz)) { if ("getIdentifier".equals(methodName)) { return this.identifier; } else if ("recoveryCommit".equals(methodName)) { return this.invokePostCoordinator(proxy, method, args); } else if ("recoveryRollback".equals(methodName)) { return this.invokePostCoordinator(proxy, method, args); } else if ("recoveryForget".equals(methodName)) { return this.invokePostCoordinator(proxy, method, args); } else {//w ww. j a v a 2s.co m throw new XAException(XAException.XAER_RMFAIL); } } else if (XAResource.class.equals(clazz)) { if ("prepare".equals(methodName)) { return this.invokePostCoordinator(proxy, method, args); } else if ("commit".equals(methodName)) { return this.invokePostCoordinator(proxy, method, args); } else if ("rollback".equals(methodName)) { return this.invokePostCoordinator(proxy, method, args); } else if ("recover".equals(methodName)) { return this.invokeGetCoordinator(proxy, method, args); } else if ("forget".equals(methodName)) { return this.invokePostCoordinator(proxy, method, args); } else { throw new XAException(XAException.XAER_RMFAIL); } } else { throw new IllegalAccessException(); } }
From source file:org.callistasoftware.netcare.api.rest.UserApi.java
@RequestMapping(value = "/load", method = RequestMethod.GET, produces = "application/json") @ResponseBody/*from w w w . j a v a 2 s. c o m*/ public ServiceResult<Patient[]> loadPatients(HttpServletRequest request) throws IllegalAccessException { final UserBaseView user = this.getUser(); if (user.isCareActor()) { final CareActorBaseView ca = (CareActorBaseView) user; ServiceResult<Patient[]> result = this.patientService.loadPatientsOnCareUnit(ca.getCareUnit()); for (Patient patient : result.getData()) { this.logAccess("load", "patients", request, patient, " "); } return result; } else { throw new IllegalAccessException(); } }
From source file:org.bytesoft.bytejta.supports.springcloud.SpringCloudCoordinator.java
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Class<?> clazz = method.getDeclaringClass(); String methodName = method.getName(); if (Object.class.equals(clazz)) { return method.invoke(this, args); } else if (RemoteCoordinator.class.equals(clazz)) { if ("getIdentifier".equals(methodName)) { return this.identifier; } else if ("getApplication".equals(methodName)) { int firstIndex = this.identifier.indexOf(":"); int lastIndex = this.identifier.lastIndexOf(":"); return firstIndex <= 0 || lastIndex <= 0 || firstIndex > lastIndex // ? null/*from ww w .j av a 2 s . c om*/ : this.identifier.subSequence(firstIndex + 1, lastIndex); } else { throw new XAException(XAException.XAER_RMFAIL); } } else if (XAResource.class.equals(clazz)) { if ("prepare".equals(methodName)) { return this.invokePostCoordinator(proxy, method, args); } else if ("commit".equals(methodName)) { return this.invokePostCoordinator(proxy, method, args); } else if ("rollback".equals(methodName)) { return this.invokePostCoordinator(proxy, method, args); } else if ("recover".equals(methodName)) { return this.invokeGetCoordinator(proxy, method, args); } else if ("forget".equals(methodName)) { return this.invokePostCoordinator(proxy, method, args); } else { throw new XAException(XAException.XAER_RMFAIL); } } else { throw new IllegalAccessException(); } }