Author: chirino Date: Thu Mar 10 10:35:00 2005 New Revision: 156976 URL: http://svn.apache.org/viewcvs?view=rev&rev=156976 Log: Updated so that use of Packet class is compatible with a change in activeio that will occur soon.
Modified: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/network/protocol/SubjectCarryingChannel.java geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/network/protocol/SubjectCarryingProtocolTest.java Modified: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/network/protocol/SubjectCarryingChannel.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/network/protocol/SubjectCarryingChannel.java?view=diff&r1=156975&r2=156976 ============================================================================== --- geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/network/protocol/SubjectCarryingChannel.java (original) +++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/network/protocol/SubjectCarryingChannel.java Thu Mar 10 10:35:00 2005 @@ -152,8 +152,10 @@ } private Packet createClearSubjectPackt() { - header.clear().write(CLEAR_SUBJECT); - return header.flip(); + header.clear(); + header.write(CLEAR_SUBJECT); + header.flip(); + return header; } private Packet createSubjectPacket(Long subjectId, byte[] hash) throws IOException { @@ -163,12 +165,15 @@ os.writeLong(subjectId.longValue()); os.writeInt(hash.length); os.close(); - return AppendedPacket.join(header.flip(), new ByteArrayPacket(hash)); + header.flip(); + return AppendedPacket.join(header, new ByteArrayPacket(hash)); } private Packet createPassthroughPacket(Packet packet) { - header.clear().write(PASSTHROUGH); - return AppendedPacket.join(header.flip(),packet); + header.clear(); + header.write(PASSTHROUGH); + header.flip(); + return AppendedPacket.join(header,packet); } public Subject getLocalSubject() { Modified: geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/network/protocol/SubjectCarryingProtocolTest.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/network/protocol/SubjectCarryingProtocolTest.java?view=diff&r1=156975&r2=156976 ============================================================================== --- geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/network/protocol/SubjectCarryingProtocolTest.java (original) +++ geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/network/protocol/SubjectCarryingProtocolTest.java Thu Mar 10 10:35:00 2005 @@ -24,19 +24,18 @@ import java.security.PrivilegedExceptionAction; import java.util.Collections; import java.util.Properties; + import javax.management.ObjectName; import javax.security.auth.Subject; import javax.security.auth.login.Configuration; import javax.security.auth.login.LoginContext; -import com.sun.security.auth.login.ConfigFile; import org.activeio.AcceptListener; import org.activeio.AsynchChannelServer; import org.activeio.Channel; import org.activeio.Packet; import org.activeio.RequestChannel; import org.activeio.RequestListener; -import org.activeio.SynchChannel; import org.activeio.adapter.AsynchChannelToClientRequestChannel; import org.activeio.adapter.AsynchChannelToServerRequestChannel; import org.activeio.adapter.AsynchToSynchChannelAdapter; @@ -45,7 +44,6 @@ import org.activeio.filter.PacketAggregatingAsynchChannel; import org.activeio.net.SocketSynchChannelFactory; import org.activeio.packet.ByteArrayPacket; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.geronimo.gbean.GBeanData; @@ -54,6 +52,8 @@ import org.apache.geronimo.security.realm.GenericSecurityRealm; import org.apache.geronimo.system.serverinfo.ServerInfo; +import com.sun.security.auth.login.ConfigFile; + /** * @version $Rev$ $Date$ @@ -165,7 +165,7 @@ new AsynchChannelToServerRequestChannel( new SubjectCarryingChannel( new PacketAggregatingAsynchChannel( - new SynchToAsynchChannelAdapter((SynchChannel)channel)))); + SynchToAsynchChannelAdapter.adapt(channel)))); requestChannel.setRequestListener(SubjectCarryingProtocolTest.this); requestChannel.start();