Changed the KeepAliveInfo packet so that it extends BaseCommand so that a reply can be requested. Should will allow for a broker or a client to get almost imediate feedback to see if the connection is down.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@390200 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-03-30 18:06:06 +00:00
parent d458445245
commit 161c24aa16
9 changed files with 13 additions and 24 deletions

View File

@ -23,7 +23,7 @@ import org.apache.activemq.util.IntrospectionSupport;
* @openwire:marshaller code="10"
* @version $Revision$
*/
public class KeepAliveInfo implements Command {
public class KeepAliveInfo extends BaseCommand {
public static final byte DATA_STRUCTURE_TYPE=CommandTypes.KEEP_ALIVE_INFO;
@ -34,20 +34,6 @@ public class KeepAliveInfo implements Command {
return DATA_STRUCTURE_TYPE;
}
public void setCommandId(int value) {
}
public int getCommandId() {
return 0;
}
public void setResponseRequired(boolean responseRequired) {
}
public boolean isResponseRequired() {
return false;
}
public boolean isResponse() {
return false;
}

View File

@ -37,7 +37,7 @@ import org.apache.activemq.command.*;
*
* @version $Revision$
*/
public class KeepAliveInfoMarshaller extends BaseDataStreamMarshaller {
public class KeepAliveInfoMarshaller extends BaseCommandMarshaller {
/**
* Return the type of Data Structure we marshal

View File

@ -35,7 +35,7 @@ import org.apache.activemq.command.*;
*
* @version $Revision$
*/
public class KeepAliveInfoTest extends DataFileGeneratorTestSupport {
public class KeepAliveInfoTest extends BaseCommandTestSupport {
public static KeepAliveInfoTest SINGLETON = new KeepAliveInfoTest();

View File

@ -32,7 +32,7 @@ namespace ActiveMQ.Commands
/// <summary>
/// The ActiveMQ KeepAliveInfo Command
/// </summary>
public class KeepAliveInfo : BaseDataStructure, Command
public class KeepAliveInfo : BaseCommand
{
public const byte ID_KeepAliveInfo = 10;

View File

@ -34,7 +34,7 @@ namespace ActiveMQ.OpenWire.V1
/// <summary>
/// Marshalling code for Open Wire Format for KeepAliveInfo
/// </summary>
class KeepAliveInfoMarshaller : BaseDataStreamMarshaller
class KeepAliveInfoMarshaller : BaseCommandMarshaller
{

View File

@ -2223,20 +2223,20 @@ ow_KeepAliveInfo *ow_KeepAliveInfo_create(apr_pool_t *pool)
apr_status_t ow_marshal1_KeepAliveInfo(ow_bit_buffer *buffer, ow_KeepAliveInfo *object)
{
ow_marshal1_DataStructure(buffer, (ow_DataStructure*)object);
ow_marshal1_BaseCommand(buffer, (ow_BaseCommand*)object);
return APR_SUCCESS;
}
apr_status_t ow_marshal2_KeepAliveInfo(ow_byte_buffer *buffer, ow_bit_buffer *bitbuffer, ow_KeepAliveInfo *object)
{
ow_marshal2_DataStructure(buffer, bitbuffer, (ow_DataStructure*)object);
ow_marshal2_BaseCommand(buffer, bitbuffer, (ow_BaseCommand*)object);
return APR_SUCCESS;
}
apr_status_t ow_unmarshal_KeepAliveInfo(ow_byte_array *buffer, ow_bit_buffer *bitbuffer, ow_KeepAliveInfo *object, apr_pool_t *pool)
{
ow_unmarshal_DataStructure(buffer, bitbuffer, (ow_DataStructure*)object, pool);
ow_unmarshal_BaseCommand(buffer, bitbuffer, (ow_BaseCommand*)object, pool);
return APR_SUCCESS;
}
@ -2384,6 +2384,7 @@ ow_boolean ow_is_a_BaseCommand(ow_DataStructure *object) {
case OW_DESTINATIONINFO_TYPE:
case OW_SHUTDOWNINFO_TYPE:
case OW_DATARESPONSE_TYPE:
case OW_KEEPALIVEINFO_TYPE:
case OW_FLUSHCOMMAND_TYPE:
case OW_MESSAGEDISPATCH_TYPE:
case OW_ACTIVEMQMAPMESSAGE_TYPE:

View File

@ -653,6 +653,8 @@ ow_boolean ow_is_a_DataResponse(ow_DataStructure *object);
typedef struct ow_KeepAliveInfo {
ow_byte structType;
ow_int commandId;
ow_boolean responseRequired;
} ow_KeepAliveInfo;
ow_KeepAliveInfo *ow_KeepAliveInfo_create(apr_pool_t *pool);

View File

@ -1 +1 @@
/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef KeepAliveInfo_hpp_ #define KeepAliveInfo_hpp_ #include <string> #include "command/BaseDataStructure.hpp" #include "util/ifr/ap.hpp" #include "util/ifr/p.hpp" namespace apache { namespace activemq { namespace client { namespace command { using namespace ifr; using namespace std; using namespace apache::activemq::client; /* * * Marshalling code for Open Wire Format for KeepAliveInfo * * * NOTE!: This file is autogenerated - do not modify! * if you need to make a change, please see the Groovy scripts in the * activemq-core module * */ class KeepAliveInfo : public BaseDataStructure { private: public: const static int TYPE = 10; public: KeepAliveInfo() ; virtual ~KeepAliveInfo() ; virtual int getCommandType() ; } ; /* namespace */ } } } } #endif /*KeepAliveInfo_hpp_*/
/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef KeepAliveInfo_hpp_ #define KeepAliveInfo_hpp_ #include <string> #include "command/BaseCommand.hpp" #include "util/ifr/ap.hpp" #include "util/ifr/p.hpp" namespace apache { namespace activemq { namespace client { namespace command { using namespace ifr; using namespace std; using namespace apache::activemq::client; /* * * Marshalling code for Open Wire Format for KeepAliveInfo * * * NOTE!: This file is autogenerated - do not modify! * if you need to make a change, please see the Groovy scripts in the * activemq-core module * */ class KeepAliveInfo : public BaseCommand { private: public: const static int TYPE = 10; public: KeepAliveInfo() ; virtual ~KeepAliveInfo() ; virtual int getCommandType() ; } ; /* namespace */ } } } } #endif /*KeepAliveInfo_hpp_*/

View File

@ -1 +1 @@
/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef KeepAliveInfoMarshaller_hpp_ #define KeepAliveInfoMarshaller_hpp_ #include <string> #include "command/IDataStructure.hpp" /* we could cut this down - for now include all possible headers */ #include "command/BrokerId.hpp" #include "command/ConnectionId.hpp" #include "command/ConsumerId.hpp" #include "command/ProducerId.hpp" #include "command/SessionId.hpp" #include "io/BinaryReader.hpp" #include "io/BinaryWriter.hpp" #include "command/BaseDataStreamMarshaller.hpp" #include "util/ifr/p.hpp" #include "protocol/ProtocolFormat.hpp" namespace apache { namespace activemq { namespace client { namespace marshal { using namespace ifr ; using namespace apache::activemq::client::command; using namespace apache::activemq::client::io; using namespace apache::activemq::client::protocol; /* * */ class KeepAliveInfoMarshaller : public BaseDataStreamMarshaller { public: KeepAliveInfoMarshaller() ; virtual ~KeepAliveInfoMarshaller() ; virtual IDataStructure* createCommand() ; virtual char getDataStructureType() ; virtual void unmarshal(ProtocolFormat& wireFormat, Object o, BinaryReader& dataIn, BooleanStream& bs) ; virtual int marshal1(ProtocolFormat& wireFormat, Object& o, BooleanStream& bs) ; virtual void marshal2(ProtocolFormat& wireFormat, Object& o, BinaryWriter& dataOut, BooleanStream& bs) ; } ; /* namespace */ } } } } #endif /*KeepAliveInfoMarshaller_hpp_*/
/* * Copyright 2006 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef KeepAliveInfoMarshaller_hpp_ #define KeepAliveInfoMarshaller_hpp_ #include <string> #include "command/IDataStructure.hpp" /* we could cut this down - for now include all possible headers */ #include "command/BrokerId.hpp" #include "command/ConnectionId.hpp" #include "command/ConsumerId.hpp" #include "command/ProducerId.hpp" #include "command/SessionId.hpp" #include "io/BinaryReader.hpp" #include "io/BinaryWriter.hpp" #include "command/BaseCommandMarshaller.hpp" #include "util/ifr/p.hpp" #include "protocol/ProtocolFormat.hpp" namespace apache { namespace activemq { namespace client { namespace marshal { using namespace ifr ; using namespace apache::activemq::client::command; using namespace apache::activemq::client::io; using namespace apache::activemq::client::protocol; /* * */ class KeepAliveInfoMarshaller : public BaseCommandMarshaller { public: KeepAliveInfoMarshaller() ; virtual ~KeepAliveInfoMarshaller() ; virtual IDataStructure* createCommand() ; virtual char getDataStructureType() ; virtual void unmarshal(ProtocolFormat& wireFormat, Object o, BinaryReader& dataIn, BooleanStream& bs) ; virtual int marshal1(ProtocolFormat& wireFormat, Object& o, BooleanStream& bs) ; virtual void marshal2(ProtocolFormat& wireFormat, Object& o, BinaryWriter& dataOut, BooleanStream& bs) ; } ; /* namespace */ } } } } #endif /*KeepAliveInfoMarshaller_hpp_*/