class DeleteIiopListener implements AdminCommand {

    @Override
    public void execute(AdminCommandContext context) {
        final Target targetUtil = services.getService(Target.class ) ;
        final Config config = targetUtil.getConfig(target) ;
        ActionReport report = context.getActionReport();
        IiopService iiopService = config.getExtensionByType(IiopService.class);

        if(!isIIOPListenerExists(iiopService)) {
            report.setMessage(localStrings.getLocalString("delete.iiop.listener" +
                ".notexists", "IIOP Listener {0} does not exist.", listener_id));
            report.setActionExitCode(ExitCode.FAILURE);
            return;
        }

        try {
            ConfigSupport.apply(new SingleConfigCode<IiopService>() {
                @Override
                public Object run(IiopService param) throws PropertyVetoException,
                        TransactionFailure {
                    List<IiopListener> listenerList = param.getIiopListener();
                    for (IiopListener listener : listenerList) {
                        String currListenerId = listener.getId();
                        if (currListenerId != null && currListenerId.equals
                                (listener_id)) {
                            listenerList.remove(listener);
                            break;
                        }
                    }
                    return listenerList;
                }
            }, iiopService);
            report.setActionExitCode(ExitCode.SUCCESS);
        } catch(TransactionFailure e) {
            String actual = e.getMessage();
            report.setMessage(localStrings.getLocalString(
                "delete.iiop.listener.fail", "failed", listener_id, actual));
            report.setActionExitCode(ExitCode.FAILURE);
            report.setFailureCause(e);
        }
    }

}