|
25 | 25 | import java.util.Hashtable; |
26 | 26 | import java.util.StringTokenizer; |
27 | 27 |
|
28 | | -import org.apache.felix.eventadmin.impl.adapter.AbstractAdapter; |
29 | | -import org.apache.felix.eventadmin.impl.adapter.BundleEventAdapter; |
30 | | -import org.apache.felix.eventadmin.impl.adapter.FrameworkEventAdapter; |
31 | | -import org.apache.felix.eventadmin.impl.adapter.LogEventAdapter; |
32 | | -import org.apache.felix.eventadmin.impl.adapter.ServiceEventAdapter; |
33 | 28 | import org.apache.felix.eventadmin.impl.handler.EventAdminImpl; |
34 | 29 | import org.apache.felix.eventadmin.impl.security.SecureEventAdminFactory; |
35 | 30 | import org.apache.felix.eventadmin.impl.tasks.DefaultThreadPool; |
@@ -172,9 +167,6 @@ public class Configuration |
172 | 167 | // The registration of the mbean |
173 | 168 | private volatile ServiceRegistration<Object> m_mbeanreg; |
174 | 169 |
|
175 | | - // all adapters |
176 | | - private AbstractAdapter[] m_adapters; |
177 | | - |
178 | 170 | private ServiceRegistration<?> m_managedServiceReg; |
179 | 171 |
|
180 | 172 | // the access control context |
@@ -431,9 +423,6 @@ private void startOrUpdate() |
431 | 423 | m_requireTopic, |
432 | 424 | m_ignoreTopics); |
433 | 425 |
|
434 | | - // Finally, adapt the outside events to our kind of events as per spec |
435 | | - adaptEvents(m_admin); |
436 | | - |
437 | 426 | // register the admin wrapped in a service factory (SecureEventAdminFactory) |
438 | 427 | // that hands-out the m_admin object wrapped in a decorator that checks |
439 | 428 | // appropriated permissions of each calling bundle |
@@ -463,14 +452,6 @@ public void destroy() |
463 | 452 | { |
464 | 453 | synchronized ( this ) |
465 | 454 | { |
466 | | - if ( m_adapters != null ) |
467 | | - { |
468 | | - for(int i=0;i<m_adapters.length;i++) |
469 | | - { |
470 | | - m_adapters[i].destroy(m_bundleContext); |
471 | | - } |
472 | | - m_adapters = null; |
473 | | - } |
474 | 455 | if ( m_managedServiceReg != null ) |
475 | 456 | { |
476 | 457 | m_managedServiceReg.unregister(); |
@@ -504,18 +485,6 @@ public void destroy() |
504 | 485 | } |
505 | 486 | } |
506 | 487 |
|
507 | | - /** |
508 | | - * Init the adapters in org.apache.felix.eventadmin.impl.adapter |
509 | | - */ |
510 | | - private void adaptEvents(final EventAdmin admin) |
511 | | - { |
512 | | - m_adapters = new AbstractAdapter[4]; |
513 | | - m_adapters[0] = new FrameworkEventAdapter(m_bundleContext, admin); |
514 | | - m_adapters[1] = new BundleEventAdapter(m_bundleContext, admin); |
515 | | - m_adapters[2] = new ServiceEventAdapter(m_bundleContext, admin); |
516 | | - m_adapters[3] = new LogEventAdapter(m_bundleContext, admin); |
517 | | - } |
518 | | - |
519 | 488 | private Object tryToCreateMetaTypeProvider(final Object managedService) |
520 | 489 | { |
521 | 490 | try |
@@ -565,7 +534,7 @@ private int getIntProperty(final String key, final Object value, |
565 | 534 | final int result; |
566 | 535 | if ( value instanceof Integer ) |
567 | 536 | { |
568 | | - result = ((Integer)value).intValue(); |
| 537 | + result = (Integer) value; |
569 | 538 | } |
570 | 539 | else |
571 | 540 | { |
@@ -606,7 +575,7 @@ private double getDoubleProperty(final String key, final Object value, |
606 | 575 | final double result; |
607 | 576 | if ( value instanceof Double ) |
608 | 577 | { |
609 | | - result = ((Double)value).doubleValue(); |
| 578 | + result = (Double) value; |
610 | 579 | } |
611 | 580 | else |
612 | 581 | { |
@@ -645,17 +614,17 @@ private boolean getBooleanProperty(final Object obj, |
645 | 614 | { |
646 | 615 | if ( obj instanceof Boolean ) |
647 | 616 | { |
648 | | - return ((Boolean)obj).booleanValue(); |
| 617 | + return (Boolean) obj; |
649 | 618 | } |
650 | 619 | String value = obj.toString().trim().toLowerCase(); |
651 | 620 |
|
652 | | - if(0 < value.length() && ("0".equals(value) || "false".equals(value) |
| 621 | + if(!value.isEmpty() && ("0".equals(value) || "false".equals(value) |
653 | 622 | || "no".equals(value))) |
654 | 623 | { |
655 | 624 | return false; |
656 | 625 | } |
657 | 626 |
|
658 | | - if(0 < value.length() && ("1".equals(value) || "true".equals(value) |
| 627 | + if(!value.isEmpty() && ("1".equals(value) || "true".equals(value) |
659 | 628 | || "yes".equals(value))) |
660 | 629 | { |
661 | 630 | return true; |
|
0 commit comments