View Javadoc
1   /*
2    * Copyright 2008 FatWire Corporation. 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 tools.gsf.facade.assetapi.listener;
17  
18  import COM.FutureTense.Interfaces.ICS;
19  import com.fatwire.assetapi.data.AssetId;
20  import com.openmarket.basic.event.AbstractAssetEventListener;
21  import org.slf4j.Logger;
22  import org.slf4j.LoggerFactory;
23  
24  /**
25   * @deprecated, incorrect use of ICS object, no replacement. All listeners using
26   * ICS should be blocking.
27   */
28  public class NonBlockingDebugAssetListener extends AbstractAssetEventListener {
29      protected static final Logger LOG = LoggerFactory.getLogger("tools.gsf.facade.assetapi.listener.NonBlockingDebugAssetListener");
30      private ICS ics;
31  
32      void printAsset(final AssetId id) {
33          throw new IllegalStateException(
34                  "Cannot be used. All access to ICS should be from blocking listeners.");
35  
36      }
37  
38      @Override
39      public void assetAdded(final AssetId id) {
40          LOG.debug("Asset added " + id);
41          printAsset(id);
42      }
43  
44      @Override
45      public void assetDeleted(final AssetId id) {
46          LOG.debug("Asset deleted " + id);
47          printAsset(id);
48  
49      }
50  
51      @Override
52      public void assetUpdated(final AssetId id) {
53          LOG.debug("Asset updated " + id);
54          printAsset(id);
55  
56      }
57  
58      public void install(final ICS ics) {
59  
60      }
61  
62      protected ICS getICS() {
63          return ics;
64      }
65  
66      @Override
67      public void init(ICS ics) {
68          this.ics = ics;
69  
70      }
71  }