<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 25 Mar 2009, at 19:23, Galder Zamarreno wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi,<br><br>I'm looking at RemoteCommandFactory in Infinispan as part as mapping the marshalling stuff to JBoss Marshalling and here's something that has confused me:<br><br>fromStream() method says:<br><br>* Creates an un-initialized command. &nbsp;Un-initialized in the sense that parameters will be set, but any components<br>* specific to the cache in question will not be set.<br>* &lt;p/><br>* You would typically set these parameters using {@link org.infinispan.commands.CommandsFactory#initializeReplicableCommand(ReplicableCommand)}<br>* &lt;p/><br><br>And then you do the following:<br><br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case StateTransferControlCommand.METHOD_ID:<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;command = new StateTransferControlCommand();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((StateTransferControlCommand) command).init(rpcManager);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br><br>Shouldn't ((StateTransferControlCommand) command).init(rpcManager) go into org.infinispan.commands.CommandsFactory#initializeReplicableCommand(ReplicableCommand).<br><br>initializeReplicableCommand() javadoc says:<br><br>* Initializes a {@link org.infinispan.commands.ReplicableCommand} read from * a data stream with components specific to the target cache instance.<br><br>The rpcManager seems to be one those components?</div></blockquote><div><br></div><div>No. &nbsp;The RPCManager is scoped as GLOBAL:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span><a href="https://svn.jboss.org/repos/infinispan/trunk/src/main/java/org/horizon/remoting/RPCManager.java">https://svn.jboss.org/repos/infinispan/trunk/src/main/java/org/infinispan/remoting/RPCManager.java</a></div><div><br></div><div>Refer to the @Scope annotation on the interface.</div><div><br></div><div>But I understand your confusion here. &nbsp;We should either:</div><div><br></div><div>1. &nbsp;Change the Javadocs on fromStream() to be more explicit, i.e., only dependent components of GLOBAL scope are injected. &nbsp;NAMED_CACHE scope components are only injected later with CommandsFactory.initializeReplicableCommand().</div><div>2. &nbsp;Remove the injection in fromStream(); have&nbsp;CommandsFactory.initializeReplicableCommand() handle all of the injection, of GLOBAL and NAMED_CACHE scoped components.</div><div><br></div><div>I have no problem with 2, if it makes your integration easier. &nbsp;In fact, I actually think 2 is probably cleaner.</div><div><br></div><div>Cheers</div><div>--</div></div><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-infinispantal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-infinispantal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Manik Surtani</div><div>Lead, JBoss Cache</div><div><a href="http://www.jbosscache.org">http://www.jbosscache.org</a><br><a href="mailto:manik@jboss.org" target="_blank">manik@jboss.org</a></div><div><br></div></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"> </div><br></body></html>