/hazelcast/src/main/java/com/hazelcast/impl/management/ShutdownMemberRequest.java

https://bitbucket.org/gabral6_gmailcom/hazelcast · Java · 50 lines · 22 code · 12 blank · 16 comment · 0 complexity · 6f667764fbc0ce0e891ef17b13b33057 MD5 · raw file

  1. /*
  2. * Copyright (c) 2008-2013, Hazelcast, Inc. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.hazelcast.impl.management;
  17. import java.io.DataInput;
  18. import java.io.DataOutput;
  19. import java.io.IOException;
  20. // author: sancar - 21.12.2012
  21. public class ShutdownMemberRequest implements ConsoleRequest {
  22. public ShutdownMemberRequest(){
  23. }
  24. public int getType() {
  25. return ConsoleRequestConstants.REQUEST_TYPE_MEMBER_SHUTDOWN;
  26. }
  27. public Object readResponse(DataInput in) throws IOException {
  28. return in.readUTF();
  29. }
  30. public void writeResponse(ManagementCenterService mcs, DataOutput dos) throws Exception {
  31. mcs.getHazelcastInstance().getLifecycleService().shutdown();
  32. dos.writeUTF("successful");
  33. }
  34. public void writeData(DataOutput out) throws IOException {
  35. }
  36. public void readData(DataInput in) throws IOException {
  37. }
  38. }