Creates a horizontal OrientationHelper for the given LayoutManager.

@param layoutManager The LayoutManager to attach to.
@return A new OrientationHelper
768145
public static OrientationHelperEx createHorizontalHelper(
        ExposeLinearLayoutManagerEx layoutManager) {
        return new OrientationHelperEx(layoutManager) {
            @Override
            public int getEndAfterPadding() {
                return mLayoutManager.getWidth() - mLayoutManager.getPaddingRight();
            }

            @Override
            public int getEnd() {
                return mLayoutManager.getWidth();
            }

            @Override
            public void offsetChildren(int amount) {
                mLayoutManager.offsetChildrenHorizontal(amount);
            }

            @Override
            public int getStartAfterPadding() {
                return mLayoutManager.getPaddingLeft();
            }

            @Override
            public int getDecoratedMeasurement(View view) {
                final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
                    view.getLayoutParams();
                return !mLayoutManager.isEnableMarginOverLap() ? mLayoutManager.getDecoratedMeasuredWidth(view) + params.leftMargin
                    + params.rightMargin : mLayoutManager.getDecoratedMeasuredWidth(view);
            }

            @Override
            public int getDecoratedMeasurementInOther(View view) {
                final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
                    view.getLayoutParams();
                return mLayoutManager.getDecoratedMeasuredHeight(view) + params.topMargin + params.bottomMargin;
            }

            @Override
            public int getDecoratedEnd(View view) {
                final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
                    view.getLayoutParams();
                return !mLayoutManager.isEnableMarginOverLap() ? mLayoutManager.getDecoratedRight(view)
                    + params.rightMargin : mLayoutManager.getDecoratedRight(view);
            }

            @Override
            public int getDecoratedStart(View view) {
                final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
                    view.getLayoutParams();
                return !mLayoutManager.isEnableMarginOverLap() ? mLayoutManager.getDecoratedLeft(view)
                    - params.leftMargin : mLayoutManager.getDecoratedLeft(view);
            }

            @Override
            public int getTotalSpace() {
                return mLayoutManager.getWidth() - mLayoutManager.getPaddingLeft()
                    - mLayoutManager.getPaddingRight();
            }

            @Override
            public void offsetChild(View view, int offset) {
                view.offsetLeftAndRight(offset);
            }

            @Override
            public int getEndPadding() {
                return mLayoutManager.getPaddingRight();
            }
        };
    }
514387
@VisibleForTesting
  void initializeHelixManager() {
    this.multiManager = new GobblinHelixMultiManager(
        this.config, new Function<Void, MessageHandlerFactory>() {
          @Override
          public MessageHandlerFactory apply(Void aVoid) {
            return GobblinClusterManager.this.getUserDefinedMessageHandlerFactory();
          }
        }, this.eventBus, stopStatus) ;
    this.multiManager.addLeadershipChangeAwareComponent(this);
  }
483313
public PersistenceManager getPersistenceManager() {
        if (persistenceManager == null) {
            try {
                persistenceManager = getPresentationManager().newPersistenceManager();
            } catch (Exception ex) {
                getPresentationManager().error(ex);
                throw new ConnectionNotFoundException();
            }
        }
        return persistenceManager;
    }
575339
@Override
    public LookupManager getLookupManager(){
        if(lookupManager == null){
            synchronized(this){
                if(lookupManager == null){
                    LookupManagerImpl lookup = new LookupManagerImpl(getDirectoryServiceClientManager());
                    lookup.start();
                    lookupManager = lookup;
                }
            }
        }
        return lookupManager;
    }
1001144
@Bean(name = "beanManager")
    @ClientScope
    protected BeanManager createManager(RemotingContext remotingContext) {
        Assert.requireNonNull(remotingContext, "remotingContext");
        return remotingContext.getBeanManager();
    }
986818
public BshClassManager getClassManager() {
        if (this.classManager != null)
            return this.classManager;
        if (this.parent != null && this.parent != JAVACODE)
            return this.parent.getClassManager();
        this.setClassManager(BshClassManager
                .createClassManager(null/* interp */));
        // Interpreter.debug("No class manager namespace:" +this);
        return this.classManager;
    }
432143
public static FrameManager newInstance (ManagedRoot root, MediaTimer timer)
    {
        FrameManager fmgr = (root instanceof ManagedJFrame && _useFlip.getValue()) ?
            new FlipFrameManager() : new BackFrameManager();
        fmgr.init(root, timer);
        return fmgr;
    }
817418
@Override
    public EntityManager createEntityManager()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "createEntityManager : " + this);

        EntityManager em = getEntityManager(false, false);
        JPAPooledEntityManager pem = new JPAPooledEntityManager(this, em, ivAbstractJpaComponent, true);
        return pem;
    }
735507
private CommandFaceButtonManager getButtonManager(String faceDescriptorId) {
		if (this.faceButtonManagers == null) {
			this.faceButtonManagers = new AbstractCachingMapDecorator() {
				protected Object create(Object key) {
					return new CommandFaceButtonManager(AbstractCommand.this, (String) key);
				}
			};
		}
		CommandFaceButtonManager m = (CommandFaceButtonManager) this.faceButtonManagers.get(faceDescriptorId);
		return m;
	}
432147
public static BeanManager getBeanManager() {
        try {
            InitialContext initialContext = new InitialContext();
            return (BeanManager) initialContext.lookup("java:comp/BeanManager");
        } catch (NamingException e) {
            log.log(Level.SEVERE, "Couldn't get BeanManager through JNDI", e);
            return null;
        }
    }
1140790
public LinearLayoutManager asVerticalListView() {
        this.presentation = PeasyPresentation.VerticalList;
        resetItemDecorations();
        resetItemAnimator();
        final LinearLayoutManager layoutManager = PeasyRecyclerView.VerticalList.newLayoutManager(getContext());
        getRecyclerView().setLayoutManager(layoutManager);
        getRecyclerView().addItemDecoration(new DividerItemDecoration(getContext(), layoutManager.getOrientation()));
        getRecyclerView().setItemAnimator(new DefaultItemAnimator());
        return layoutManager;
    }
1140278
public SpacePermissionManager getSpacePermissionManager() {
        if (spacePermissionManager != null) {
            return spacePermissionManager;
        }
        spacePermissionManager = (SpacePermissionManager) ContainerManager.getComponent("spacePermissionManager");
        return spacePermissionManager;
    }
801753
public com.google.api.ads.adwords.axis.v201809.mcm.ManagedCustomer getManager() {
        return manager;
    }
469874
public static ComponentManager getInstance() throws SshException {
		synchronized (ComponentManager.class) {
			if (instance == null) {
				instance = new JCEComponentManager();
				instance.init();
			}
			return instance;
		}
	}
238972
protected CatalogManager createCatalogManager() {

		CatalogManager manager = new CatalogManager();
		manager.setIgnoreMissingProperties(true);
		ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
		StringBuffer builder = new StringBuffer();
		boolean first = true;
		for (int i = 0; i < catalogs.length; i++) {
			final String catalog = catalogs[i];

			try {
				Enumeration<URL> enumeration = classLoader.getResources(catalog);
				while (enumeration.hasMoreElements()) {
					if (!first) {
						builder.append(';');
					} else {
						first = false;
					}
					URL resource = enumeration.nextElement();
					builder.append(resource.toExternalForm());
				}
			} catch (IOException ioe) {
				getLog().warn("Failed to search for catalog files: " + catalog);
				// Let's be a little tolerant here.
			}
		}
		//builder.append("jar:file:/Users/salmanqureshi/.m2/repository/net/sf/docbook/docbook-xsl/1.76.1/docbook-xsl-1.76.1-ns-resources.zip!/docbook/catalog.xml");
		String catalogFiles = builder.toString();
		if (catalogFiles.length() == 0) {
			getLog().warn("Failed to find catalog files.");
		} else {
			if (getLog().isDebugEnabled()) {
				getLog().debug("Catalogs to load: " + catalogFiles);
			}
			manager.setCatalogFiles(catalogFiles);
		}
		return manager;
	}
365601
public void setOrientation(int orientation) {
        if (orientation != HORIZONTAL && orientation != VERTICAL) {
            throw new IllegalArgumentException("invalid orientation:" + orientation);
        }
        assertNotInLayoutOrScroll(null);
        if (orientation == mOrientation) {
            return;
        }
        mOrientation = orientation;
        mOrientationHelper = null;
        requestLayout();
    }
777938
public void setLayoutHelpers(@Nullable List<LayoutHelper> helpers) {
        List<LayoutHelper> layoutHelpers = mHelperFinder.getLayoutHelpers();
        Iterator<LayoutHelper> it0 = layoutHelpers.iterator();
        while (it0.hasNext()) {
            LayoutHelper helper = it0.next();
            oldHelpersSet.put(System.identityHashCode(helper), helper);
        }

        // set ranges
        if (helpers != null) {
            int start = 0;
            Iterator<LayoutHelper> it1 = helpers.iterator();
            while (it1.hasNext()) {
                LayoutHelper helper = it1.next();
                if (helper instanceof FixAreaLayoutHelper) {
                    ((FixAreaLayoutHelper) helper).setAdjuster(mFixAreaAdjustor);
                }

                if (helper instanceof BaseLayoutHelper && mLayoutViewBindListener != null) {
                    ((BaseLayoutHelper) helper).setLayoutViewBindListener(mLayoutViewBindListener);
                }


                if (helper.getItemCount() > 0) {
                    helper.setRange(start, start + helper.getItemCount() - 1);
                } else {
                    helper.setRange(-1, -1);
                }

                start += helper.getItemCount();
            }
        }

        this.mHelperFinder.setLayouts(helpers);

        layoutHelpers = mHelperFinder.getLayoutHelpers();
        Iterator<LayoutHelper> iterator = layoutHelpers.iterator();
        while (iterator.hasNext()) {
            LayoutHelper layoutHelper = iterator.next();
            newHelpersSet.put(System.identityHashCode(layoutHelper), layoutHelper);
        }

        for (Iterator<Map.Entry<Integer, LayoutHelper>> it = oldHelpersSet.entrySet().iterator(); it.hasNext(); ) {
            Map.Entry<Integer, LayoutHelper> entry = it.next();
            Integer key = entry.getKey();
            if (newHelpersSet.containsKey(key)) {
                newHelpersSet.remove(key);
                it.remove();
            }
        }


        for (LayoutHelper helper : oldHelpersSet.values()) {
            helper.clear(this);
        }

        if (!oldHelpersSet.isEmpty() || !newHelpersSet.isEmpty()) {
            mSpaceMeasured = false;
        }

        oldHelpersSet.clear();
        newHelpersSet.clear();
        requestLayout();
    }