From: <tk...@hy...> - 2008-06-22 10:32:59
|
Author: tkeeney Date: 2008-06-20 16:20:22 -0700 (Fri, 20 Jun 2008) New Revision: 9855 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=9855 Modified: trunk/src/org/hyperic/hq/agent/client/AbstractCommandsClient.java trunk/src/org/hyperic/hq/transport/AgentProxyFactory.java trunk/src/org/hyperic/hq/transport/AgentProxyFactoryImpl.java Log: Don't need to pass a separate unidirectional parameter when creating the agent proxies. Just use the unidirectional property in the agent pojo. Modified: trunk/src/org/hyperic/hq/agent/client/AbstractCommandsClient.java =================================================================== --- trunk/src/org/hyperic/hq/agent/client/AbstractCommandsClient.java 2008-06-20 19:39:10 UTC (rev 9854) +++ trunk/src/org/hyperic/hq/agent/client/AbstractCommandsClient.java 2008-06-20 23:20:22 UTC (rev 9855) @@ -64,8 +64,7 @@ try { proxy = _factory.createSyncService(_agent, - serviceInterface, - _agent.isUnidirectional()); + serviceInterface); } catch (Exception e) { _log.error("Error creating proxy to remote service.", e); throw new AgentConnectionException("Error creating proxy to remote service.", e); @@ -83,8 +82,7 @@ try { proxy = _factory.createAsyncService(_agent, serviceInterface, - guaranteed, - _agent.isUnidirectional()); + guaranteed); } catch (Exception e) { _log.error("Error creating proxy to remote service.", e); throw new AgentConnectionException("Error creating proxy to remote service.", e); Modified: trunk/src/org/hyperic/hq/transport/AgentProxyFactory.java =================================================================== --- trunk/src/org/hyperic/hq/transport/AgentProxyFactory.java 2008-06-20 19:39:10 UTC (rev 9854) +++ trunk/src/org/hyperic/hq/transport/AgentProxyFactory.java 2008-06-20 23:20:22 UTC (rev 9855) @@ -37,13 +37,10 @@ * * @param agent The agent. * @param serviceInterface The service interface. - * @param unidirectional <code>true</code> for a unidirectional transport; - * <code>false</code> for a bidirectional transport. * @return A proxy to the agent service. * @throws Exception if an exception occurs acquiring the proxy. */ - Object createSyncService(Agent agent, Class serviceInterface, - boolean unidirectional) throws Exception; + Object createSyncService(Agent agent, Class serviceInterface) throws Exception; /** * Create an asynchronous proxy to an agent service where proxy method @@ -57,13 +54,10 @@ * @param serviceInterface The service interface. * @param guaranteed <code>true</code> to guarantee message delivery; * <code>false</code> if guaranteed delivery is not required. - * @param unidirectional <code>true</code> for a unidirectional transport; - * <code>false</code> for a bidirectional transport. * @return A proxy to the agent service. * @throws Exception if an exception occurs acquiring the proxy. */ - Object createAsyncService(Agent agent, Class serviceInterface, - boolean guaranteed, boolean unidirectional) throws Exception; + Object createAsyncService(Agent agent, Class serviceInterface, boolean guaranteed) throws Exception; /** * When a proxy to an agent service is no longer in use, it should be Modified: trunk/src/org/hyperic/hq/transport/AgentProxyFactoryImpl.java =================================================================== --- trunk/src/org/hyperic/hq/transport/AgentProxyFactoryImpl.java 2008-06-20 19:39:10 UTC (rev 9854) +++ trunk/src/org/hyperic/hq/transport/AgentProxyFactoryImpl.java 2008-06-20 23:20:22 UTC (rev 9855) @@ -65,13 +65,11 @@ } /** - * @see org.hyperic.hq.transport.AgentProxyFactory#createSyncService(Agent, java.lang.Class, boolean) + * @see org.hyperic.hq.transport.AgentProxyFactory#createSyncService(Agent, java.lang.Class) */ - public Object createSyncService(Agent agent, - Class serviceInterface, - boolean unidirectional) throws Exception { + public Object createSyncService(Agent agent, Class serviceInterface) throws Exception { - if (unidirectional) { + if (agent.isUnidirectional()) { throw new UnsupportedOperationException( ".ORG instance does not support the unidirectional transport."); } else { @@ -81,15 +79,14 @@ } /** - * @see org.hyperic.hq.transport.AgentProxyFactory#createAsyncService(Agent, java.lang.Class, boolean, boolean) + * @see org.hyperic.hq.transport.AgentProxyFactory#createAsyncService(Agent, java.lang.Class, boolean) */ - public Object createAsyncService(Agent agent, + public Object createAsyncService(Agent agent, Class serviceInterface, - boolean guaranteed, - boolean unidirectional) throws Exception { + boolean guaranteed) throws Exception { TransportUtils.assertVoidReturnTypes(serviceInterface); - if (unidirectional) { + if (agent.isUnidirectional()) { throw new UnsupportedOperationException( ".ORG instance does not support the unidirectional transport."); } else { |