/*
 *  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you 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.
 */
package org.apache.isis.applib;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import org.apache.isis.applib.annotation.Programmatic;
import org.apache.isis.applib.services.eventbus.EventBusService;

/**
 * Convenience class for services that act as subscribers.
 */
public abstract class AbstractSubscriber {

    //region > postConstruct, preDestroy

    @Programmatic
    @PostConstruct
    public void postConstruct() {
        eventBusService.register(this);
    }

    @Programmatic
    @PreDestroy
    public void preDestroy() {
        eventBusService.unregister(this);
    }
    //endregion

    //region > injected services
    @javax.inject.Inject
    protected DomainObjectContainer container;

    @javax.inject.Inject
    protected EventBusService eventBusService;
    //endregion

}

@@ -895,42 +895,69 @@
 ct;%0A
+%0A
 import 
-javax.annotation.PreDestroy
+org.apache.isis.applib.annotation.DomainServiceLayout
 ;%0Aim
@@ -1146,111 +1146,99 @@
  */%0A
-public abstract class AbstractSubscriber %7B%0A%0A    //region %3E postConstruct, preDestroy%0A%0A    @Programmatic
+@DomainServiceLayout(%0A        menuOrder = %221%22%0A)%0Apublic abstract class AbstractSubscriber %7B%0A
 %0A   
@@ -1356,24 +1356,8 @@
 tic%0A
-    @PreDestroy%0A
     
@@ -1435,57 +1435,9 @@
   %7D%0A
-    //endregion%0A%0A    //region %3E injected services
+%0A
 %0A   
@@ -1581,24 +1581,8 @@
 ice;
-%0A    //endregion
 %0A%0A%7D%0A

annotate with @DomainServiceLayout. Remove some comments and unnecessary @Programmatic annotation for the @PostConstruct and @PreDestroy.