@SuppressWarnings("unchecked")
public NextAction handleWrite(final FilterChainContext ctx) throws IOException {
final Plug plug = plugAttr.get(ctx);
// check if the output plug is installed
if (plug != null && plug.isPlugged) {
final WritableMessage msg = ctx.getMessage();
// check if the message could be appended
if (!msg.isExternal()) {
final Buffer buf = (Buffer) msg;
// if there's MessageCloner - call it,
// because the caller is not aware of buffering and will expect
// some result (either buffer is written or queued),