PageRenderTime 37ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/jboss-as-7.1.1.Final/controller-client/src/main/java/org/jboss/as/controller/client/OperationAttachments.java

#
Java | 70 lines | 22 code | 8 blank | 40 comment | 0 complexity | d59d2341c9abd79ae180658294c1feb8 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. /*
  2. * JBoss, Home of Professional Open Source.
  3. * Copyright 2006, Red Hat Middleware LLC, and individual contributors
  4. * as indicated by the @author tags. See the copyright.txt file in the
  5. * distribution for a full listing of individual contributors.
  6. *
  7. * This is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU Lesser General Public License as
  9. * published by the Free Software Foundation; either version 2.1 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This software is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this software; if not, write to the Free
  19. * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  21. */
  22. package org.jboss.as.controller.client;
  23. import java.io.Closeable;
  24. import java.io.InputStream;
  25. import java.util.Collections;
  26. import java.util.List;
  27. /**
  28. * The operation attachments. This interface extends {@code Closeable}
  29. * which can be used to close all associated input streams with
  30. * this attachment.
  31. *
  32. * @author <a href="kabir.khan@jboss.com">Kabir Khan</a>
  33. */
  34. public interface OperationAttachments extends Closeable {
  35. /**
  36. * Flag indicating whether the streams should be automatically closed
  37. * once the operation completed.
  38. *
  39. * @return {@code true} if the streams are going to be closed, false otherwise
  40. */
  41. boolean isAutoCloseStreams();
  42. /**
  43. * Input streams associated with the operation
  44. *
  45. * @return the streams. If there are none an empty list is returned
  46. */
  47. List<InputStream> getInputStreams();
  48. OperationAttachments EMPTY = new OperationAttachments() {
  49. @Override
  50. public boolean isAutoCloseStreams() {
  51. return false;
  52. }
  53. @Override
  54. public List<InputStream> getInputStreams() {
  55. return Collections.emptyList();
  56. }
  57. @Override
  58. public void close() {
  59. //
  60. }
  61. };
  62. }