List of usage examples for org.springframework.aop.target SingletonTargetSource getTarget
@Override
public Object getTarget()
From source file:annis.test.TestHelper.java
public static Object proxyTarget(Object proxy) { if (!(proxy instanceof Proxy)) fail("Not a proxy: " + proxy); SingletonTargetSource targetSource = null; try {//from w w w .j ava 2s. c o m targetSource = (SingletonTargetSource) proxy.getClass().getMethod("getTargetSource").invoke(proxy); } catch (Exception e) { fail(e.getMessage()); } if (targetSource == null) fail("Couldn't get target of annisDao proxy"); return targetSource.getTarget(); }
From source file:org.springframework.aop.target.CommonsPoolTargetSourceTests.java
@Test public void testTargetSourceSerializableWithoutConfigMixin() throws Exception { CommonsPoolTargetSource cpts = (CommonsPoolTargetSource) beanFactory.getBean("personPoolTargetSource"); SingletonTargetSource serialized = (SingletonTargetSource) SerializationTestUtils .serializeAndDeserialize(cpts); assertTrue(serialized.getTarget() instanceof Person); }